From 1048f6ada8c0daa37f8604f98c5faf26f0848860 Mon Sep 17 00:00:00 2001 From: Arthur Vickers Date: Mon, 4 Dec 2023 15:30:04 +0000 Subject: [PATCH] Infer type mapping suitable for concatenating two results (#32510) * Work on type mapping inference for string concatenation Fixes #32325, see also #32333 * Tweaks, update baselines add more tests and cleanup * Update baselines, add more tests, some cleanup. --------- Co-authored-by: Shay Rojansky --- .../Query/SqlExpressionFactory.cs | 47 ++++++++ .../NorthwindMiscellaneousQueryCosmosTest.cs | 60 ++++++++++ .../TestUtilities/TestSqlLoggerFactory.cs | 2 +- .../Query/GearsOfWarQueryTestBase.cs | 4 +- .../NorthwindMiscellaneousQueryTestBase.cs | 57 ++++++++++ .../NorthwindBulkUpdatesSqlServerTest.cs | 4 +- .../Migrations/MigrationsSqlServerTest.cs | 54 ++++----- ...avigationsCollectionsQuerySqlServerTest.cs | 4 +- ...CollectionsSharedTypeQuerySqlServerTest.cs | 4 +- ...tionsCollectionsSplitQuerySqlServerTest.cs | 2 +- .../ComplexNavigationsQuerySqlServerTest.cs | 16 +-- ...NavigationsSharedTypeQuerySqlServerTest.cs | 18 +-- .../Query/ComplexTypeQuerySqlServerTest.cs | 46 ++++---- .../Query/CompositeKeysQuerySqlServerTest.cs | 2 +- .../CompositeKeysSplitQuerySqlServerTest.cs | 26 ++--- .../Query/Ef6GroupBySqlServerTest.cs | 6 +- .../Query/FunkyDataQuerySqlServerTest.cs | 4 +- .../Query/GearsOfWarQuerySqlServerTest.cs | 26 ++--- .../Query/JsonQuerySqlServerTest.cs | 4 +- ...indAggregateOperatorsQuerySqlServerTest.cs | 26 ++--- .../NorthwindDbFunctionsQuerySqlServerTest.cs | 4 +- .../NorthwindFunctionsQuerySqlServerTest.cs | 14 +-- .../Query/NorthwindJoinQuerySqlServerTest.cs | 2 +- ...orthwindMiscellaneousQuerySqlServerTest.cs | 104 ++++++++++++++++-- ...orthwindSetOperationsQuerySqlServerTest.cs | 2 +- .../Query/NorthwindWhereQuerySqlServerTest.cs | 50 ++++----- .../Query/NullSemanticsQuerySqlServerTest.cs | 2 +- .../OptionalDependentQuerySqlServerTest.cs | 20 ++-- .../Query/OwnedEntityQuerySqlServerTest.cs | 2 +- .../Query/SimpleQuerySqlServerTest.cs | 10 +- .../Query/TPCGearsOfWarQuerySqlServerTest.cs | 30 ++--- .../Query/TPTGearsOfWarQuerySqlServerTest.cs | 28 ++--- ...avigationsCollectionsQuerySqlServerTest.cs | 4 +- ...CollectionsSharedTypeQuerySqlServerTest.cs | 2 +- .../TemporalGearsOfWarQuerySqlServerTest.cs | 30 ++--- .../Query/TemporalOwnedQuerySqlServerTest.cs | 2 +- .../Update/JsonUpdateSqlServerTest.cs | 6 +- .../Migrations/MigrationsSqliteTest.cs | 2 +- .../Query/ComplexTypeQuerySqliteTest.cs | 46 ++++---- .../Query/GearsOfWarQuerySqliteTest.cs | 30 ++--- .../Query/JsonQuerySqliteTest.cs | 2 +- .../NorthwindMiscellaneousQuerySqliteTest.cs | 2 +- .../Query/NorthwindWhereQuerySqliteTest.cs | 8 +- .../Query/NullSemanticsQuerySqliteTest.cs | 2 +- .../Query/OptionalDependentQuerySqliteTest.cs | 20 ++-- .../Query/TPCGearsOfWarQuerySqliteTest.cs | 2 +- .../Query/TPTGearsOfWarQuerySqliteTest.cs | 2 +- .../Update/JsonUpdateSqliteTest.cs | 2 +- .../NorthwindQueryVisualBasicTest.vb | 2 +- 49 files changed, 546 insertions(+), 298 deletions(-) diff --git a/src/EFCore.Relational/Query/SqlExpressionFactory.cs b/src/EFCore.Relational/Query/SqlExpressionFactory.cs index 1a408f27e20..e8c57a8c6e2 100644 --- a/src/EFCore.Relational/Query/SqlExpressionFactory.cs +++ b/src/EFCore.Relational/Query/SqlExpressionFactory.cs @@ -202,6 +202,53 @@ private SqlExpression ApplyTypeMappingOnSqlBinary( } case ExpressionType.Add: + inferredTypeMapping = typeMapping; + + if (inferredTypeMapping is null) + { + var leftTypeMapping = left.TypeMapping; + var rightTypeMapping = right.TypeMapping; + if (leftTypeMapping != null || rightTypeMapping != null) + { + // Infer null size (nvarchar(max)) if either side has no size. + // Note that for constants, we could instead look at the value length; but that requires we know the type mappings + // which can have a size (string/byte[], maybe something else?). + var inferredSize = leftTypeMapping?.Size is { } leftSize && rightTypeMapping?.Size is { } rightSize + ? leftSize + rightSize + : (int?)null; + + // Unless both sides are fixed length, the result isn't fixed length. + var inferredFixedLength = leftTypeMapping?.IsFixedLength is true && rightTypeMapping?.IsFixedLength is true; + + // Default to Unicode unless both sides are non-unicode. + var inferredUnicode = !(leftTypeMapping?.IsUnicode is false && rightTypeMapping?.IsUnicode is false); + var baseTypeMapping = leftTypeMapping ?? rightTypeMapping!; + + inferredTypeMapping = leftTypeMapping?.Size == inferredSize + && leftTypeMapping?.IsFixedLength == inferredFixedLength + && leftTypeMapping?.IsUnicode == inferredUnicode + ? leftTypeMapping + : rightTypeMapping?.Size == inferredSize + && rightTypeMapping?.IsFixedLength == inferredFixedLength + && rightTypeMapping?.IsUnicode == inferredUnicode + ? rightTypeMapping + : _typeMappingSource.FindMapping( + baseTypeMapping.ClrType, + storeTypeName: null, + keyOrIndex: false, + inferredUnicode, + inferredSize, + rowVersion: false, + inferredFixedLength, + baseTypeMapping.Precision, + baseTypeMapping.Scale); + } + } + + resultType = inferredTypeMapping?.ClrType ?? left.Type; + resultTypeMapping = inferredTypeMapping; + break; + case ExpressionType.Subtract: case ExpressionType.Multiply: case ExpressionType.Divide: diff --git a/test/EFCore.Cosmos.FunctionalTests/Query/NorthwindMiscellaneousQueryCosmosTest.cs b/test/EFCore.Cosmos.FunctionalTests/Query/NorthwindMiscellaneousQueryCosmosTest.cs index 441fa0dc542..967fcf3969b 100644 --- a/test/EFCore.Cosmos.FunctionalTests/Query/NorthwindMiscellaneousQueryCosmosTest.cs +++ b/test/EFCore.Cosmos.FunctionalTests/Query/NorthwindMiscellaneousQueryCosmosTest.cs @@ -4622,6 +4622,66 @@ await AssertTranslationFailed( AssertSql(); } + public override async Task Contains_over_concatenated_columns_with_different_sizes(bool async) + { + await base.Contains_over_concatenated_columns_with_different_sizes(async); + + AssertSql( + """ +SELECT c +FROM root c +WHERE ((c["Discriminator"] = "Customer") AND (c["CustomerID"] || c["CompanyName"]) IN ("ALFKIAlfreds Futterkiste", "ANATRAna Trujillo Emparedados y helados")) +"""); + } + + public override async Task Contains_over_concatenated_column_and_constant(bool async) + { + await base.Contains_over_concatenated_column_and_constant(async); + + AssertSql( + """ +SELECT c +FROM root c +WHERE ((c["Discriminator"] = "Customer") AND (c["CustomerID"] || "SomeConstant") IN ("ALFKISomeConstant", "ANATRSomeConstant", "ALFKIX")) +"""); + } + + public override async Task Contains_over_concatenated_columns_both_fixed_length(bool async) + { + await AssertTranslationFailed( + () => base.Contains_over_concatenated_columns_both_fixed_length(async)); + + AssertSql(); + } + + public override async Task Contains_over_concatenated_column_and_parameter(bool async) + { + await base.Contains_over_concatenated_column_and_parameter(async); + + AssertSql( + """ +@__someVariable_1='SomeVariable' + +SELECT c +FROM root c +WHERE ((c["Discriminator"] = "Customer") AND (c["CustomerID"] || @__someVariable_1) IN ("ALFKISomeVariable", "ANATRSomeVariable", "ALFKIX")) +"""); + } + + public override async Task Contains_over_concatenated_parameter_and_constant(bool async) + { + await base.Contains_over_concatenated_parameter_and_constant(async); + + AssertSql( + """ +@__Contains_0='true' + +SELECT c +FROM root c +WHERE ((c["Discriminator"] = "Customer") AND @__Contains_0) +"""); + } + private void AssertSql(params string[] expected) => Fixture.TestSqlLoggerFactory.AssertBaseline(expected); diff --git a/test/EFCore.Relational.Specification.Tests/TestUtilities/TestSqlLoggerFactory.cs b/test/EFCore.Relational.Specification.Tests/TestUtilities/TestSqlLoggerFactory.cs index bf57b50d51e..12eb14f7557 100644 --- a/test/EFCore.Relational.Specification.Tests/TestUtilities/TestSqlLoggerFactory.cs +++ b/test/EFCore.Relational.Specification.Tests/TestUtilities/TestSqlLoggerFactory.cs @@ -254,7 +254,7 @@ void RewriteSourceWithNewBaseline(string fileName, int lineNumber) indentBuilder.Append(" "); var indent = indentBuilder.ToString(); var newBaseLine = $@"Assert{(forUpdate ? "ExecuteUpdate" : "")}Sql( -{string.Join("," + Environment.NewLine + indent + "//" + Environment.NewLine, SqlStatements.Skip(offset).Take(count).Select(sql => "\"\"\"" + Environment.NewLine + sql + Environment.NewLine + "\"\"\""))})"; +{string.Join("," + Environment.NewLine + indent + "//" + Environment.NewLine, SqlStatements.Skip(offset).Take(count).Select(sql => indent + "\"\"\"" + Environment.NewLine + sql + Environment.NewLine + "\"\"\""))})"; var numNewlinesInRewritten = newBaseLine.Count(c => c is '\n' or '\r'); writer.Write(newBaseLine); diff --git a/test/EFCore.Specification.Tests/Query/GearsOfWarQueryTestBase.cs b/test/EFCore.Specification.Tests/Query/GearsOfWarQueryTestBase.cs index 37de7758ad6..27c9bc22d75 100644 --- a/test/EFCore.Specification.Tests/Query/GearsOfWarQueryTestBase.cs +++ b/test/EFCore.Specification.Tests/Query/GearsOfWarQueryTestBase.cs @@ -1603,9 +1603,9 @@ public virtual Task Non_unicode_string_literals_is_used_for_non_unicode_column_w where c.Location.Contains("Jacinto") select c); - [ConditionalTheory] + [ConditionalTheory] // Issue #32325 [MemberData(nameof(IsAsyncData))] - public virtual Task Non_unicode_string_literals_is_used_for_non_unicode_column_with_concat(bool async) + public virtual Task Unicode_string_literals_is_used_for_non_unicode_column_with_concat(bool async) => AssertQuery( async, ss => from c in ss.Set() diff --git a/test/EFCore.Specification.Tests/Query/NorthwindMiscellaneousQueryTestBase.cs b/test/EFCore.Specification.Tests/Query/NorthwindMiscellaneousQueryTestBase.cs index 1479ade406c..3e64dea65c4 100644 --- a/test/EFCore.Specification.Tests/Query/NorthwindMiscellaneousQueryTestBase.cs +++ b/test/EFCore.Specification.Tests/Query/NorthwindMiscellaneousQueryTestBase.cs @@ -5674,5 +5674,62 @@ await AssertQuery( .Select(g => new { g.Key, MaxTimestamp = g.Select(e => e.Order.OrderDate).Max() }) .OrderBy(x => x.MaxTimestamp) .Select(x => x)); + } + + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Contains_over_concatenated_columns_with_different_sizes(bool async) + { + var data = new[] { "ALFKI" + "Alfreds Futterkiste", "ANATR" + "Ana Trujillo Emparedados y helados" }; + + return AssertQuery( + async, + ss => ss.Set().Where(c => data.Contains(c.CustomerID + c.CompanyName))); + } + + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Contains_over_concatenated_column_and_constant(bool async) + { + var data = new[] { "ALFKI" + "SomeConstant", "ANATR" + "SomeConstant", "ALFKI" + "X"}; + + return AssertQuery( + async, + ss => ss.Set().Where(c => data.Contains(c.CustomerID + "SomeConstant"))); + } + + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Contains_over_concatenated_column_and_parameter(bool async) + { + var data = new[] { "ALFKI" + "SomeVariable", "ANATR" + "SomeVariable", "ALFKI" + "X" }; + var someVariable = "SomeVariable"; + + return AssertQuery( + async, + ss => ss.Set().Where(c => data.Contains(c.CustomerID + someVariable))); + } + + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Contains_over_concatenated_parameter_and_constant(bool async) + { + var data = new[] { "ALFKI" + "SomeConstant", "ANATR" + "SomeConstant" }; + var someVariable = "ALFKI"; + + return AssertQuery( + async, + ss => ss.Set().Where(c => data.Contains(someVariable + "SomeConstant"))); + } + + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Contains_over_concatenated_columns_both_fixed_length(bool async) + { + var data = new[] { "ALFKIALFKI", "ALFKI", "ANATR" + "Ana Trujillo Emparedados y helados", "ANATR" + "ANATR"}; + + return AssertQuery( + async, + ss => ss.Set().Where(o => data.Contains(o.CustomerID + o.Customer.CustomerID))); } } diff --git a/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/NorthwindBulkUpdatesSqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/NorthwindBulkUpdatesSqlServerTest.cs index 5f59f53e240..2987d957b01 100644 --- a/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/NorthwindBulkUpdatesSqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/NorthwindBulkUpdatesSqlServerTest.cs @@ -1038,8 +1038,8 @@ public override async Task Update_Where_set_property_plus_parameter(bool async) await base.Update_Where_set_property_plus_parameter(async); AssertExecuteUpdateSql( - """ -@__value_0='Abc' (Size = 30) +""" +@__value_0='Abc' (Size = 4000) UPDATE [c] SET [c].[ContactName] = COALESCE([c].[ContactName], N'') + @__value_0 diff --git a/test/EFCore.SqlServer.FunctionalTests/Migrations/MigrationsSqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Migrations/MigrationsSqlServerTest.cs index 20539afe4e9..85d8d5e15d3 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Migrations/MigrationsSqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Migrations/MigrationsSqlServerTest.cs @@ -6946,7 +6946,7 @@ await Test( }); AssertSql( -""" + """ ALTER TABLE [Customer] SET (SYSTEM_VERSIONING = OFF) """, // @@ -7024,7 +7024,7 @@ await Test( }); AssertSql( -""" + """ DECLARE @historyTableSchema sysname = SCHEMA_NAME() EXEC(N'CREATE TABLE [Customer] ( [Id] int NOT NULL IDENTITY, @@ -7084,7 +7084,7 @@ await Test( }); AssertSql( -""" + """ ALTER TABLE [Customer] SET (SYSTEM_VERSIONING = OFF) """, // @@ -7148,7 +7148,7 @@ await Test( }); AssertSql( -""" + """ ALTER TABLE [Customer] SET (SYSTEM_VERSIONING = OFF) """, // @@ -7211,7 +7211,7 @@ await Test( }); AssertSql( -""" + """ ALTER TABLE [Customer] SET (SYSTEM_VERSIONING = OFF) """, // @@ -7346,7 +7346,7 @@ await Test( }); AssertSql( -""" + """ ALTER TABLE [Customer] ADD [Number] int NOT NULL DEFAULT 0; """); } @@ -7401,7 +7401,7 @@ await Test( }); AssertSql( -""" + """ ALTER TABLE [Customer] SET (SYSTEM_VERSIONING = OFF) """, // @@ -7483,7 +7483,7 @@ await Test( }); AssertSql( -""" + """ EXEC sp_rename N'[Customer].[Number]', N'RenamedNumber', N'COLUMN'; """); } @@ -7534,7 +7534,7 @@ await Test( }); AssertSql( -""" + """ ALTER TABLE [Customer] SET (SYSTEM_VERSIONING = OFF) """, // @@ -7605,7 +7605,7 @@ await Test( }); AssertSql( -""" + """ ALTER TABLE [mySchema].[Customers] SET (SYSTEM_VERSIONING = OFF) """, // @@ -7682,7 +7682,7 @@ await Test( }); AssertSql( -""" + """ ALTER TABLE [Customer] SET (SYSTEM_VERSIONING = OFF) """, // @@ -7772,7 +7772,7 @@ await Test( }); AssertSql( -""" + """ DECLARE @var0 sysname; SELECT @var0 = [d].[name] FROM [sys].[default_constraints] [d] @@ -7838,7 +7838,7 @@ await Test( }); AssertSql( -""" + """ ALTER TABLE [Customers] ADD [End] datetime2 NOT NULL DEFAULT '9999-12-31T23:59:59.9999999'; """, // @@ -9487,7 +9487,7 @@ await Test( }); AssertSql( -""" + """ EXEC sp_rename N'[Customers].[PeriodStart]', N'Start', N'COLUMN'; """, // @@ -9557,7 +9557,7 @@ await Test( }); AssertSql( -""" + """ EXEC sp_rename N'[Customers].[PeriodStart]', N'ValidFrom', N'COLUMN'; """, // @@ -9616,7 +9616,7 @@ await Test( }); AssertSql( -""" + """ ALTER TABLE [Customers] ADD [End] datetime2 NOT NULL DEFAULT '9999-12-31T23:59:59.9999999'; """, // @@ -9695,7 +9695,7 @@ await Test( }); AssertSql( -""" + """ DECLARE @var0 sysname; SELECT @var0 = [d].[name] FROM [sys].[default_constraints] [d] @@ -9782,7 +9782,7 @@ await Test( }); AssertSql( -""" + """ EXEC sp_rename N'[Customers].[Number]', N'NewNumber', N'COLUMN'; """, // @@ -9859,7 +9859,7 @@ await Test( }); AssertSql( -""" + """ ALTER TABLE [Customers] SET (SYSTEM_VERSIONING = OFF) """, // @@ -9941,7 +9941,7 @@ await Test( }); AssertSql( -""" + """ ALTER TABLE [Customers] SET (SYSTEM_VERSIONING = OFF) """, // @@ -10041,7 +10041,7 @@ await Test( }); AssertSql( -""" + """ ALTER TABLE [Customers] SET (SYSTEM_VERSIONING = OFF) """, // @@ -10128,7 +10128,7 @@ await Test( }); AssertSql( -""" + """ ALTER TABLE [Customers] DROP CONSTRAINT [PK_Customers]; """, // @@ -10219,7 +10219,7 @@ await Test( }); AssertSql( -""" + """ ALTER TABLE [Customers] DROP CONSTRAINT [PK_Customers]; """, // @@ -10318,7 +10318,7 @@ await Test( }); AssertSql( -""" + """ ALTER TABLE [Customers] DROP CONSTRAINT [PK_Customers]; """, // @@ -10406,7 +10406,7 @@ await Test( }); AssertSql( -""" + """ ALTER TABLE [Customers] SET (SYSTEM_VERSIONING = OFF) """, // @@ -10512,7 +10512,7 @@ await Test( }); AssertSql( -""" + """ ALTER TABLE [Customers] SET (SYSTEM_VERSIONING = OFF) """, // @@ -10616,7 +10616,7 @@ await Test( }); AssertSql( -""" + """ ALTER TABLE [Customers] SET (SYSTEM_VERSIONING = OFF) """, // diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsCollectionsQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsCollectionsQuerySqlServerTest.cs index 52fc8c74eb3..16856bddb96 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsCollectionsQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsCollectionsQuerySqlServerTest.cs @@ -2014,7 +2014,7 @@ public override async Task Filtered_include_Skip_Take_with_another_Skip_Take_on_ await base.Filtered_include_Skip_Take_with_another_Skip_Take_on_top_level(async); AssertSql( -""" + """ @__p_0='1' @__p_1='5' @@ -2983,7 +2983,7 @@ public override async Task Project_collection_and_nested_conditional(bool async) await base.Project_collection_and_nested_conditional(async); AssertSql( -""" + """ SELECT [l].[Id], [l0].[Name], [l0].[Id], CASE WHEN [l].[Id] = 1 THEN N'01' WHEN [l].[Id] = 2 THEN N'02' diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsCollectionsSharedTypeQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsCollectionsSharedTypeQuerySqlServerTest.cs index c2b2b3a5e68..9eb962097c0 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsCollectionsSharedTypeQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsCollectionsSharedTypeQuerySqlServerTest.cs @@ -1635,7 +1635,7 @@ public override async Task Filtered_include_Skip_Take_with_another_Skip_Take_on_ await base.Filtered_include_Skip_Take_with_another_Skip_Take_on_top_level(async); AssertSql( -""" + """ @__p_0='1' @__p_1='5' @@ -3875,7 +3875,7 @@ public override async Task Project_collection_and_nested_conditional(bool async) await base.Project_collection_and_nested_conditional(async); AssertSql( -""" + """ SELECT [l].[Id], [t].[Level2_Name], [t].[Id], CASE WHEN [l].[Id] = 1 THEN N'01' WHEN [l].[Id] = 2 THEN N'02' diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsCollectionsSplitQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsCollectionsSplitQuerySqlServerTest.cs index 344d9531f97..e0ed399b07e 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsCollectionsSplitQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsCollectionsSplitQuerySqlServerTest.cs @@ -4418,7 +4418,7 @@ public override async Task Project_collection_and_nested_conditional(bool async) await base.Project_collection_and_nested_conditional(async); AssertSql( -""" + """ SELECT [l].[Id], CASE WHEN [l].[Id] = 1 THEN N'01' WHEN [l].[Id] = 2 THEN N'02' diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsQuerySqlServerTest.cs index 98e2def94f3..e44de22023c 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsQuerySqlServerTest.cs @@ -987,7 +987,7 @@ public override async Task Complex_navigations_with_predicate_projected_into_ano await base.Complex_navigations_with_predicate_projected_into_anonymous_type2(async); AssertSql( -""" + """ SELECT [l].[Name], [l2].[Id] FROM [LevelThree] AS [l] INNER JOIN [LevelTwo] AS [l0] ON [l].[Level2_Required_Id] = [l0].[Id] @@ -1157,7 +1157,7 @@ public override async Task Query_source_materialization_bug_4547(bool async) await base.Query_source_materialization_bug_4547(async); AssertSql( -""" + """ SELECT [l0].[Id] FROM [LevelThree] AS [l] INNER JOIN [LevelOne] AS [l0] ON [l].[Id] = ( @@ -1568,7 +1568,7 @@ public override async Task Projection_select_correct_table_with_anonymous_projec await base.Projection_select_correct_table_with_anonymous_projection_in_subquery(async); AssertSql( -""" + """ @__p_0='3' SELECT TOP(@__p_0) [l].[Name] @@ -1585,7 +1585,7 @@ public override async Task Projection_select_correct_table_in_subquery_when_mate await base.Projection_select_correct_table_in_subquery_when_materialization_is_not_required_in_multiple_joins(async); AssertSql( -""" + """ @__p_0='3' SELECT TOP(@__p_0) [l0].[Name] @@ -2058,7 +2058,7 @@ public override async Task Required_navigation_on_a_subquery_with_First_in_predi await base.Required_navigation_on_a_subquery_with_First_in_predicate(async); AssertSql( -""" + """ SELECT [l].[Id], [l].[Date], [l].[Level1_Optional_Id], [l].[Level1_Required_Id], [l].[Name], [l].[OneToMany_Optional_Inverse2Id], [l].[OneToMany_Optional_Self_Inverse2Id], [l].[OneToMany_Required_Inverse2Id], [l].[OneToMany_Required_Self_Inverse2Id], [l].[OneToOne_Optional_PK_Inverse2Id], [l].[OneToOne_Optional_Self2Id] FROM [LevelTwo] AS [l] WHERE [l].[Id] = 7 AND (( @@ -2577,7 +2577,7 @@ public override async Task Where_on_multilevel_reference_in_subquery_with_outer_ await base.Where_on_multilevel_reference_in_subquery_with_outer_projection(async); AssertSql( -""" + """ @__p_0='0' @__p_1='10' @@ -3643,7 +3643,7 @@ public override async Task Null_check_removal_applied_recursively(bool async) await base.Null_check_removal_applied_recursively(async); AssertSql( -""" + """ SELECT [l].[Id], [l].[Date], [l].[Name], [l].[OneToMany_Optional_Self_Inverse1Id], [l].[OneToMany_Required_Self_Inverse1Id], [l].[OneToOne_Optional_Self1Id] FROM [LevelOne] AS [l] LEFT JOIN [LevelTwo] AS [l0] ON [l].[Id] = [l0].[Level1_Optional_Id] @@ -3658,7 +3658,7 @@ public override async Task Null_check_different_structure_does_not_remove_null_c await base.Null_check_different_structure_does_not_remove_null_checks(async); AssertSql( -""" + """ SELECT [l].[Id], [l].[Date], [l].[Name], [l].[OneToMany_Optional_Self_Inverse1Id], [l].[OneToMany_Required_Self_Inverse1Id], [l].[OneToOne_Optional_Self1Id] FROM [LevelOne] AS [l] LEFT JOIN [LevelTwo] AS [l0] ON [l].[Id] = [l0].[Level1_Optional_Id] diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsSharedTypeQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsSharedTypeQuerySqlServerTest.cs index adc3e377938..e8e28d77b75 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsSharedTypeQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsSharedTypeQuerySqlServerTest.cs @@ -591,7 +591,7 @@ public override async Task Null_check_different_structure_does_not_remove_null_c await base.Null_check_different_structure_does_not_remove_null_checks(async); AssertSql( -""" + """ SELECT [l].[Id], [l].[Date], [l].[Name] FROM [Level1] AS [l] LEFT JOIN ( @@ -797,7 +797,7 @@ public override async Task Select_with_joined_where_clause_cast_using_as(bool as await base.Select_with_joined_where_clause_cast_using_as(async); AssertSql( -""" + """ SELECT [l].[Id], [l].[Date], [l].[Name] FROM [Level1] AS [l] LEFT JOIN ( @@ -2114,7 +2114,7 @@ public override async Task Required_navigation_on_a_subquery_with_First_in_predi await base.Required_navigation_on_a_subquery_with_First_in_predicate(async); AssertSql( -""" + """ SELECT [t].[Id], [t].[OneToOne_Required_PK_Date], [t].[Level1_Optional_Id], [t].[Level1_Required_Id], [t].[Level2_Name], [t].[OneToMany_Optional_Inverse2Id], [t].[OneToMany_Required_Inverse2Id], [t].[OneToOne_Optional_PK_Inverse2Id] FROM [Level1] AS [l] LEFT JOIN ( @@ -2857,7 +2857,7 @@ public override async Task Projection_select_correct_table_with_anonymous_projec await base.Projection_select_correct_table_with_anonymous_projection_in_subquery(async); AssertSql( -""" + """ @__p_0='3' SELECT TOP(@__p_0) [t].[Level2_Name] @@ -4552,7 +4552,7 @@ public override async Task Null_check_removal_applied_recursively(bool async) await base.Null_check_removal_applied_recursively(async); AssertSql( -""" + """ SELECT [l].[Id], [l].[Date], [l].[Name] FROM [Level1] AS [l] LEFT JOIN ( @@ -4953,7 +4953,7 @@ public override async Task Query_source_materialization_bug_4547(bool async) await base.Query_source_materialization_bug_4547(async); AssertSql( -""" + """ SELECT [l2].[Id] FROM [Level1] AS [l] LEFT JOIN ( @@ -5163,7 +5163,7 @@ public override async Task Where_on_multilevel_reference_in_subquery_with_outer_ await base.Where_on_multilevel_reference_in_subquery_with_outer_projection(async); AssertSql( -""" + """ @__p_0='0' @__p_1='10' @@ -5205,7 +5205,7 @@ public override async Task Projection_select_correct_table_in_subquery_when_mate await base.Projection_select_correct_table_in_subquery_when_materialization_is_not_required_in_multiple_joins(async); AssertSql( -""" + """ @__p_0='3' SELECT TOP(@__p_0) [l1].[Name] @@ -6340,7 +6340,7 @@ public override async Task Complex_navigations_with_predicate_projected_into_ano await base.Complex_navigations_with_predicate_projected_into_anonymous_type2(async); AssertSql( -""" + """ SELECT [t0].[Level3_Name] AS [Name], [l4].[Id] FROM [Level1] AS [l] LEFT JOIN ( diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/ComplexTypeQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/ComplexTypeQuerySqlServerTest.cs index 52ed43e3ea5..0f112c82460 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/ComplexTypeQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/ComplexTypeQuerySqlServerTest.cs @@ -385,7 +385,7 @@ public override async Task Filter_on_property_inside_struct_complex_type(bool as await base.Filter_on_property_inside_struct_complex_type(async); AssertSql( -""" + """ SELECT [v].[Id], [v].[Name], [v].[BillingAddress_AddressLine1], [v].[BillingAddress_AddressLine2], [v].[BillingAddress_ZipCode], [v].[BillingAddress_Country_Code], [v].[BillingAddress_Country_FullName], [v].[ShippingAddress_AddressLine1], [v].[ShippingAddress_AddressLine2], [v].[ShippingAddress_ZipCode], [v].[ShippingAddress_Country_Code], [v].[ShippingAddress_Country_FullName] FROM [ValuedCustomer] AS [v] WHERE [v].[ShippingAddress_ZipCode] = 7728 @@ -397,7 +397,7 @@ public override async Task Filter_on_property_inside_nested_struct_complex_type( await base.Filter_on_property_inside_nested_struct_complex_type(async); AssertSql( -""" + """ SELECT [v].[Id], [v].[Name], [v].[BillingAddress_AddressLine1], [v].[BillingAddress_AddressLine2], [v].[BillingAddress_ZipCode], [v].[BillingAddress_Country_Code], [v].[BillingAddress_Country_FullName], [v].[ShippingAddress_AddressLine1], [v].[ShippingAddress_AddressLine2], [v].[ShippingAddress_ZipCode], [v].[ShippingAddress_Country_Code], [v].[ShippingAddress_Country_FullName] FROM [ValuedCustomer] AS [v] WHERE [v].[ShippingAddress_Country_Code] = N'DE' @@ -409,7 +409,7 @@ public override async Task Filter_on_property_inside_struct_complex_type_after_s await base.Filter_on_property_inside_struct_complex_type_after_subquery(async); AssertSql( -""" + """ @__p_0='1' SELECT DISTINCT [t].[Id], [t].[Name], [t].[BillingAddress_AddressLine1], [t].[BillingAddress_AddressLine2], [t].[BillingAddress_ZipCode], [t].[BillingAddress_Country_Code], [t].[BillingAddress_Country_FullName], [t].[ShippingAddress_AddressLine1], [t].[ShippingAddress_AddressLine2], [t].[ShippingAddress_ZipCode], [t].[ShippingAddress_Country_Code], [t].[ShippingAddress_Country_FullName] @@ -428,7 +428,7 @@ public override async Task Filter_on_property_inside_nested_struct_complex_type_ await base.Filter_on_property_inside_nested_struct_complex_type_after_subquery(async); AssertSql( -""" + """ @__p_0='1' SELECT DISTINCT [t].[Id], [t].[Name], [t].[BillingAddress_AddressLine1], [t].[BillingAddress_AddressLine2], [t].[BillingAddress_ZipCode], [t].[BillingAddress_Country_Code], [t].[BillingAddress_Country_FullName], [t].[ShippingAddress_AddressLine1], [t].[ShippingAddress_AddressLine2], [t].[ShippingAddress_ZipCode], [t].[ShippingAddress_Country_Code], [t].[ShippingAddress_Country_FullName] @@ -447,7 +447,7 @@ public override async Task Filter_on_required_property_inside_required_struct_co await base.Filter_on_required_property_inside_required_struct_complex_type_on_optional_navigation(async); AssertSql( -""" + """ SELECT [v].[Id], [v].[OptionalCustomerId], [v].[RequiredCustomerId], [v0].[Id], [v0].[Name], [v0].[BillingAddress_AddressLine1], [v0].[BillingAddress_AddressLine2], [v0].[BillingAddress_ZipCode], [v0].[BillingAddress_Country_Code], [v0].[BillingAddress_Country_FullName], [v0].[ShippingAddress_AddressLine1], [v0].[ShippingAddress_AddressLine2], [v0].[ShippingAddress_ZipCode], [v0].[ShippingAddress_Country_Code], [v0].[ShippingAddress_Country_FullName], [v1].[Id], [v1].[Name], [v1].[BillingAddress_AddressLine1], [v1].[BillingAddress_AddressLine2], [v1].[BillingAddress_ZipCode], [v1].[BillingAddress_Country_Code], [v1].[BillingAddress_Country_FullName], [v1].[ShippingAddress_AddressLine1], [v1].[ShippingAddress_AddressLine2], [v1].[ShippingAddress_ZipCode], [v1].[ShippingAddress_Country_Code], [v1].[ShippingAddress_Country_FullName] FROM [ValuedCustomerGroup] AS [v] LEFT JOIN [ValuedCustomer] AS [v0] ON [v].[OptionalCustomerId] = [v0].[Id] @@ -461,7 +461,7 @@ public override async Task Filter_on_required_property_inside_required_struct_co await base.Filter_on_required_property_inside_required_struct_complex_type_on_required_navigation(async); AssertSql( -""" + """ SELECT [v].[Id], [v].[OptionalCustomerId], [v].[RequiredCustomerId], [v1].[Id], [v1].[Name], [v1].[BillingAddress_AddressLine1], [v1].[BillingAddress_AddressLine2], [v1].[BillingAddress_ZipCode], [v1].[BillingAddress_Country_Code], [v1].[BillingAddress_Country_FullName], [v1].[ShippingAddress_AddressLine1], [v1].[ShippingAddress_AddressLine2], [v1].[ShippingAddress_ZipCode], [v1].[ShippingAddress_Country_Code], [v1].[ShippingAddress_Country_FullName], [v0].[Id], [v0].[Name], [v0].[BillingAddress_AddressLine1], [v0].[BillingAddress_AddressLine2], [v0].[BillingAddress_ZipCode], [v0].[BillingAddress_Country_Code], [v0].[BillingAddress_Country_FullName], [v0].[ShippingAddress_AddressLine1], [v0].[ShippingAddress_AddressLine2], [v0].[ShippingAddress_ZipCode], [v0].[ShippingAddress_Country_Code], [v0].[ShippingAddress_Country_FullName] FROM [ValuedCustomerGroup] AS [v] INNER JOIN [ValuedCustomer] AS [v0] ON [v].[RequiredCustomerId] = [v0].[Id] @@ -485,7 +485,7 @@ public override async Task Project_struct_complex_type_via_required_navigation(b await base.Project_struct_complex_type_via_required_navigation(async); AssertSql( -""" + """ SELECT [v0].[ShippingAddress_AddressLine1], [v0].[ShippingAddress_AddressLine2], [v0].[ShippingAddress_ZipCode], [v0].[ShippingAddress_Country_Code], [v0].[ShippingAddress_Country_FullName] FROM [ValuedCustomerGroup] AS [v] INNER JOIN [ValuedCustomer] AS [v0] ON [v].[RequiredCustomerId] = [v0].[Id] @@ -497,7 +497,7 @@ public override async Task Load_struct_complex_type_after_subquery_on_entity_typ await base.Load_struct_complex_type_after_subquery_on_entity_type(async); AssertSql( -""" + """ @__p_0='1' SELECT DISTINCT [t].[Id], [t].[Name], [t].[BillingAddress_AddressLine1], [t].[BillingAddress_AddressLine2], [t].[BillingAddress_ZipCode], [t].[BillingAddress_Country_Code], [t].[BillingAddress_Country_FullName], [t].[ShippingAddress_AddressLine1], [t].[ShippingAddress_AddressLine2], [t].[ShippingAddress_ZipCode], [t].[ShippingAddress_Country_Code], [t].[ShippingAddress_Country_FullName] @@ -515,7 +515,7 @@ public override async Task Select_struct_complex_type(bool async) await base.Select_struct_complex_type(async); AssertSql( -""" + """ SELECT [v].[ShippingAddress_AddressLine1], [v].[ShippingAddress_AddressLine2], [v].[ShippingAddress_ZipCode], [v].[ShippingAddress_Country_Code], [v].[ShippingAddress_Country_FullName] FROM [ValuedCustomer] AS [v] """); @@ -526,7 +526,7 @@ public override async Task Select_nested_struct_complex_type(bool async) await base.Select_nested_struct_complex_type(async); AssertSql( -""" + """ SELECT [v].[ShippingAddress_Country_Code], [v].[ShippingAddress_Country_FullName] FROM [ValuedCustomer] AS [v] """); @@ -537,7 +537,7 @@ public override async Task Select_single_property_on_nested_struct_complex_type( await base.Select_single_property_on_nested_struct_complex_type(async); AssertSql( -""" + """ SELECT [v].[ShippingAddress_Country_FullName] FROM [ValuedCustomer] AS [v] """); @@ -548,7 +548,7 @@ public override async Task Select_struct_complex_type_Where(bool async) await base.Select_struct_complex_type_Where(async); AssertSql( -""" + """ SELECT [v].[ShippingAddress_AddressLine1], [v].[ShippingAddress_AddressLine2], [v].[ShippingAddress_ZipCode], [v].[ShippingAddress_Country_Code], [v].[ShippingAddress_Country_FullName] FROM [ValuedCustomer] AS [v] WHERE [v].[ShippingAddress_ZipCode] = 7728 @@ -560,7 +560,7 @@ public override async Task Select_struct_complex_type_Distinct(bool async) await base.Select_struct_complex_type_Distinct(async); AssertSql( -""" + """ SELECT DISTINCT [v].[ShippingAddress_AddressLine1], [v].[ShippingAddress_AddressLine2], [v].[ShippingAddress_ZipCode], [v].[ShippingAddress_Country_Code], [v].[ShippingAddress_Country_FullName] FROM [ValuedCustomer] AS [v] """); @@ -571,7 +571,7 @@ public override async Task Struct_complex_type_equals_struct_complex_type(bool a await base.Struct_complex_type_equals_struct_complex_type(async); AssertSql( -""" + """ SELECT [v].[Id], [v].[Name], [v].[BillingAddress_AddressLine1], [v].[BillingAddress_AddressLine2], [v].[BillingAddress_ZipCode], [v].[BillingAddress_Country_Code], [v].[BillingAddress_Country_FullName], [v].[ShippingAddress_AddressLine1], [v].[ShippingAddress_AddressLine2], [v].[ShippingAddress_ZipCode], [v].[ShippingAddress_Country_Code], [v].[ShippingAddress_Country_FullName] FROM [ValuedCustomer] AS [v] WHERE [v].[ShippingAddress_AddressLine1] = [v].[BillingAddress_AddressLine1] AND ([v].[ShippingAddress_AddressLine2] = [v].[BillingAddress_AddressLine2] OR ([v].[ShippingAddress_AddressLine2] IS NULL AND [v].[BillingAddress_AddressLine2] IS NULL)) AND [v].[ShippingAddress_ZipCode] = [v].[BillingAddress_ZipCode] @@ -583,7 +583,7 @@ public override async Task Struct_complex_type_equals_constant(bool async) await base.Struct_complex_type_equals_constant(async); AssertSql( -""" + """ SELECT [v].[Id], [v].[Name], [v].[BillingAddress_AddressLine1], [v].[BillingAddress_AddressLine2], [v].[BillingAddress_ZipCode], [v].[BillingAddress_Country_Code], [v].[BillingAddress_Country_FullName], [v].[ShippingAddress_AddressLine1], [v].[ShippingAddress_AddressLine2], [v].[ShippingAddress_ZipCode], [v].[ShippingAddress_Country_Code], [v].[ShippingAddress_Country_FullName] FROM [ValuedCustomer] AS [v] WHERE [v].[ShippingAddress_AddressLine1] = N'804 S. Lakeshore Road' AND [v].[ShippingAddress_AddressLine2] IS NULL AND [v].[ShippingAddress_ZipCode] = 38654 AND [v].[ShippingAddress_Country_Code] = N'US' AND [v].[ShippingAddress_Country_FullName] = N'United States' @@ -595,7 +595,7 @@ public override async Task Struct_complex_type_equals_parameter(bool async) await base.Struct_complex_type_equals_parameter(async); AssertSql( -""" + """ @__entity_equality_address_0_AddressLine1='804 S. Lakeshore Road' (Size = 4000) @__entity_equality_address_0_ZipCode='38654' (Nullable = true) @__entity_equality_address_0_Code='US' (Size = 4000) @@ -619,7 +619,7 @@ public override async Task Contains_over_struct_complex_type(bool async) await base.Contains_over_struct_complex_type(async); AssertSql( -""" + """ @__entity_equality_address_0_AddressLine1='804 S. Lakeshore Road' (Size = 4000) @__entity_equality_address_0_ZipCode='38654' (Nullable = true) @__entity_equality_address_0_Code='US' (Size = 4000) @@ -639,7 +639,7 @@ public override async Task Concat_struct_complex_type(bool async) await base.Concat_struct_complex_type(async); AssertSql( -""" + """ SELECT [v].[ShippingAddress_AddressLine1], [v].[ShippingAddress_AddressLine2], [v].[ShippingAddress_ZipCode], [v].[ShippingAddress_Country_Code], [v].[ShippingAddress_Country_FullName] FROM [ValuedCustomer] AS [v] WHERE [v].[Id] = 1 @@ -655,7 +655,7 @@ public override async Task Concat_entity_type_containing_struct_complex_property await base.Concat_entity_type_containing_struct_complex_property(async); AssertSql( -""" + """ SELECT [v].[Id], [v].[Name], [v].[BillingAddress_AddressLine1], [v].[BillingAddress_AddressLine2], [v].[BillingAddress_ZipCode], [v].[BillingAddress_Country_Code], [v].[BillingAddress_Country_FullName], [v].[ShippingAddress_AddressLine1], [v].[ShippingAddress_AddressLine2], [v].[ShippingAddress_ZipCode], [v].[ShippingAddress_Country_Code], [v].[ShippingAddress_Country_FullName] FROM [ValuedCustomer] AS [v] WHERE [v].[Id] = 1 @@ -671,7 +671,7 @@ public override async Task Union_entity_type_containing_struct_complex_property( await base.Union_entity_type_containing_struct_complex_property(async); AssertSql( -""" + """ SELECT [v].[Id], [v].[Name], [v].[BillingAddress_AddressLine1], [v].[BillingAddress_AddressLine2], [v].[BillingAddress_ZipCode], [v].[BillingAddress_Country_Code], [v].[BillingAddress_Country_FullName], [v].[ShippingAddress_AddressLine1], [v].[ShippingAddress_AddressLine2], [v].[ShippingAddress_ZipCode], [v].[ShippingAddress_Country_Code], [v].[ShippingAddress_Country_FullName] FROM [ValuedCustomer] AS [v] WHERE [v].[Id] = 1 @@ -687,7 +687,7 @@ public override async Task Union_struct_complex_type(bool async) await base.Union_struct_complex_type(async); AssertSql( -""" + """ SELECT [v].[ShippingAddress_AddressLine1], [v].[ShippingAddress_AddressLine2], [v].[ShippingAddress_ZipCode], [v].[ShippingAddress_Country_Code], [v].[ShippingAddress_Country_FullName] FROM [ValuedCustomer] AS [v] WHERE [v].[Id] = 1 @@ -703,7 +703,7 @@ public override async Task Concat_property_in_struct_complex_type(bool async) await base.Concat_property_in_struct_complex_type(async); AssertSql( -""" + """ SELECT [v].[ShippingAddress_AddressLine1] FROM [ValuedCustomer] AS [v] UNION ALL @@ -717,7 +717,7 @@ public override async Task Union_property_in_struct_complex_type(bool async) await base.Union_property_in_struct_complex_type(async); AssertSql( -""" + """ SELECT [v].[ShippingAddress_AddressLine1] FROM [ValuedCustomer] AS [v] UNION diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/CompositeKeysQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/CompositeKeysQuerySqlServerTest.cs index 6fd6abd1462..8222f481d22 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/CompositeKeysQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/CompositeKeysQuerySqlServerTest.cs @@ -168,7 +168,7 @@ FROM [CompositeThrees] AS [c8] LEFT JOIN [CompositeFours] AS [c10] ON [c8].[Id1] = [c10].[OneToMany_Optional_Inverse4Id1] AND [c8].[Id2] = [c10].[OneToMany_Optional_Inverse4Id2] ) AS [t3] ON [c7].[Id1] = [t3].[OneToMany_Optional_Inverse3Id1] AND [c7].[Id2] = [t3].[OneToMany_Optional_Inverse3Id2] LEFT JOIN ( - SELECT [c11].[Name], [c11].[Id1], [c11].[Id2], [c12].[Id1] AS [Id10], [c12].[Id2] AS [Id20], [c12].[Level3_Optional_Id1], [c12].[Level3_Optional_Id2], [c12].[Level3_Required_Id1], [c12].[Level3_Required_Id2], [c12].[Name] AS [Name0], [c12].[OneToMany_Optional_Inverse4Id1], [c12].[OneToMany_Optional_Inverse4Id2], [c12].[OneToMany_Optional_Self_Inverse4Id1], [c12].[OneToMany_Optional_Self_Inverse4Id2], [c12].[OneToMany_Required_Inverse4Id1], [c12].[OneToMany_Required_Inverse4Id2], [c12].[OneToMany_Required_Self_Inverse4Id1], [c12].[OneToMany_Required_Self_Inverse4Id2], [c12].[OneToOne_Optional_PK_Inverse4Id1], [c12].[OneToOne_Optional_PK_Inverse4Id2], [c12].[OneToOne_Optional_Self4Id1], [c12].[OneToOne_Optional_Self4Id2], [c13].[Id1] AS [Id11], [c13].[Id2] AS [Id21], [c13].[Level3_Optional_Id1] AS [Level3_Optional_Id10], [c13].[Level3_Optional_Id2] AS [Level3_Optional_Id20], [c13].[Level3_Required_Id1] AS [Level3_Required_Id10], [c13].[Level3_Required_Id2] AS [Level3_Required_Id20], [c13].[Name] AS [Name1], [c13].[OneToMany_Optional_Inverse4Id1] AS [OneToMany_Optional_Inverse4Id10], [c13].[OneToMany_Optional_Inverse4Id2] AS [OneToMany_Optional_Inverse4Id20], [c13].[OneToMany_Optional_Self_Inverse4Id1] AS [OneToMany_Optional_Self_Inverse4Id10], [c13].[OneToMany_Optional_Self_Inverse4Id2] AS [OneToMany_Optional_Self_Inverse4Id20], [c13].[OneToMany_Required_Inverse4Id1] AS [OneToMany_Required_Inverse4Id10], [c13].[OneToMany_Required_Inverse4Id2] AS [OneToMany_Required_Inverse4Id20], [c13].[OneToMany_Required_Self_Inverse4Id1] AS [OneToMany_Required_Self_Inverse4Id10], [c13].[OneToMany_Required_Self_Inverse4Id2] AS [OneToMany_Required_Self_Inverse4Id20], [c13].[OneToOne_Optional_PK_Inverse4Id1] AS [OneToOne_Optional_PK_Inverse4Id10], [c13].[OneToOne_Optional_PK_Inverse4Id2] AS [OneToOne_Optional_PK_Inverse4Id20], [c13].[OneToOne_Optional_Self4Id1] AS [OneToOne_Optional_Self4Id10], [c13].[OneToOne_Optional_Self4Id2] AS [OneToOne_Optional_Self4Id20], [c13].[Id1] + CAST([c13].[Id2] AS nvarchar(450)) AS [c], [c11].[OneToMany_Optional_Inverse3Id1], [c11].[OneToMany_Optional_Inverse3Id2] + SELECT [c11].[Name], [c11].[Id1], [c11].[Id2], [c12].[Id1] AS [Id10], [c12].[Id2] AS [Id20], [c12].[Level3_Optional_Id1], [c12].[Level3_Optional_Id2], [c12].[Level3_Required_Id1], [c12].[Level3_Required_Id2], [c12].[Name] AS [Name0], [c12].[OneToMany_Optional_Inverse4Id1], [c12].[OneToMany_Optional_Inverse4Id2], [c12].[OneToMany_Optional_Self_Inverse4Id1], [c12].[OneToMany_Optional_Self_Inverse4Id2], [c12].[OneToMany_Required_Inverse4Id1], [c12].[OneToMany_Required_Inverse4Id2], [c12].[OneToMany_Required_Self_Inverse4Id1], [c12].[OneToMany_Required_Self_Inverse4Id2], [c12].[OneToOne_Optional_PK_Inverse4Id1], [c12].[OneToOne_Optional_PK_Inverse4Id2], [c12].[OneToOne_Optional_Self4Id1], [c12].[OneToOne_Optional_Self4Id2], [c13].[Id1] AS [Id11], [c13].[Id2] AS [Id21], [c13].[Level3_Optional_Id1] AS [Level3_Optional_Id10], [c13].[Level3_Optional_Id2] AS [Level3_Optional_Id20], [c13].[Level3_Required_Id1] AS [Level3_Required_Id10], [c13].[Level3_Required_Id2] AS [Level3_Required_Id20], [c13].[Name] AS [Name1], [c13].[OneToMany_Optional_Inverse4Id1] AS [OneToMany_Optional_Inverse4Id10], [c13].[OneToMany_Optional_Inverse4Id2] AS [OneToMany_Optional_Inverse4Id20], [c13].[OneToMany_Optional_Self_Inverse4Id1] AS [OneToMany_Optional_Self_Inverse4Id10], [c13].[OneToMany_Optional_Self_Inverse4Id2] AS [OneToMany_Optional_Self_Inverse4Id20], [c13].[OneToMany_Required_Inverse4Id1] AS [OneToMany_Required_Inverse4Id10], [c13].[OneToMany_Required_Inverse4Id2] AS [OneToMany_Required_Inverse4Id20], [c13].[OneToMany_Required_Self_Inverse4Id1] AS [OneToMany_Required_Self_Inverse4Id10], [c13].[OneToMany_Required_Self_Inverse4Id2] AS [OneToMany_Required_Self_Inverse4Id20], [c13].[OneToOne_Optional_PK_Inverse4Id1] AS [OneToOne_Optional_PK_Inverse4Id10], [c13].[OneToOne_Optional_PK_Inverse4Id2] AS [OneToOne_Optional_PK_Inverse4Id20], [c13].[OneToOne_Optional_Self4Id1] AS [OneToOne_Optional_Self4Id10], [c13].[OneToOne_Optional_Self4Id2] AS [OneToOne_Optional_Self4Id20], [c13].[Id1] + CAST([c13].[Id2] AS nvarchar(max)) AS [c], [c11].[OneToMany_Optional_Inverse3Id1], [c11].[OneToMany_Optional_Inverse3Id2] FROM [CompositeThrees] AS [c11] LEFT JOIN [CompositeFours] AS [c12] ON [c11].[Id1] = [c12].[OneToMany_Optional_Inverse4Id1] AND [c11].[Id2] = [c12].[OneToMany_Optional_Inverse4Id2] LEFT JOIN [CompositeFours] AS [c13] ON [c11].[Id1] = [c13].[OneToMany_Required_Inverse4Id1] AND [c11].[Id2] = [c13].[OneToMany_Required_Inverse4Id2] diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/CompositeKeysSplitQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/CompositeKeysSplitQuerySqlServerTest.cs index cd3650987b3..55a33bd3ceb 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/CompositeKeysSplitQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/CompositeKeysSplitQuerySqlServerTest.cs @@ -167,14 +167,14 @@ FROM [CompositeOnes] AS [c] ORDER BY [c].[Name], [c].[Id1], [c].[Id2] """, // - """ +""" SELECT [c0].[Name], [c].[Id1], [c].[Id2], [c0].[Id1], [c0].[Id2] FROM [CompositeOnes] AS [c] INNER JOIN [CompositeTwos] AS [c0] ON [c].[Id1] = [c0].[OneToMany_Optional_Inverse2Id1] AND [c].[Id2] = [c0].[OneToMany_Optional_Inverse2Id2] ORDER BY [c].[Name], [c].[Id1], [c].[Id2], [c0].[Id1], [c0].[Id2] """, // - """ +""" SELECT [c].[Id1], [c].[Id2], [c0].[Id1], [c0].[Id2], [c1].[Id1], [c1].[Id2] FROM [CompositeOnes] AS [c] INNER JOIN [CompositeTwos] AS [c0] ON [c].[Id1] = [c0].[OneToMany_Optional_Inverse2Id1] AND [c].[Id2] = [c0].[OneToMany_Optional_Inverse2Id2] @@ -182,7 +182,7 @@ FROM [CompositeOnes] AS [c] ORDER BY [c].[Name], [c].[Id1], [c].[Id2], [c0].[Id1], [c0].[Id2], [c1].[Id2] DESC, [c1].[Id1] DESC """, // - """ +""" SELECT [c1].[Name], [c].[Id1], [c].[Id2], [c0].[Id1], [c0].[Id2], [c1].[Id1], [c1].[Id2] FROM [CompositeOnes] AS [c] INNER JOIN [CompositeTwos] AS [c0] ON [c].[Id1] = [c0].[OneToMany_Optional_Inverse2Id1] AND [c].[Id2] = [c0].[OneToMany_Optional_Inverse2Id2] @@ -190,7 +190,7 @@ FROM [CompositeOnes] AS [c] ORDER BY [c].[Name], [c].[Id1], [c].[Id2], [c0].[Id1], [c0].[Id2], [c1].[Id1], [c1].[Id2] """, // - """ +""" SELECT [c2].[Id1], [c2].[Id2], [c2].[Level3_Optional_Id1], [c2].[Level3_Optional_Id2], [c2].[Level3_Required_Id1], [c2].[Level3_Required_Id2], [c2].[Name], [c2].[OneToMany_Optional_Inverse4Id1], [c2].[OneToMany_Optional_Inverse4Id2], [c2].[OneToMany_Optional_Self_Inverse4Id1], [c2].[OneToMany_Optional_Self_Inverse4Id2], [c2].[OneToMany_Required_Inverse4Id1], [c2].[OneToMany_Required_Inverse4Id2], [c2].[OneToMany_Required_Self_Inverse4Id1], [c2].[OneToMany_Required_Self_Inverse4Id2], [c2].[OneToOne_Optional_PK_Inverse4Id1], [c2].[OneToOne_Optional_PK_Inverse4Id2], [c2].[OneToOne_Optional_Self4Id1], [c2].[OneToOne_Optional_Self4Id2], [c].[Id1], [c].[Id2], [c0].[Id1], [c0].[Id2], [c1].[Id1], [c1].[Id2] FROM [CompositeOnes] AS [c] INNER JOIN [CompositeTwos] AS [c0] ON [c].[Id1] = [c0].[OneToMany_Optional_Inverse2Id1] AND [c].[Id2] = [c0].[OneToMany_Optional_Inverse2Id2] @@ -199,7 +199,7 @@ FROM [CompositeOnes] AS [c] ORDER BY [c].[Name], [c].[Id1], [c].[Id2], [c0].[Id1], [c0].[Id2], [c1].[Id1], [c1].[Id2] """, // - """ +""" SELECT [c2].[Id1], [c2].[Id2], [c2].[Level3_Optional_Id1], [c2].[Level3_Optional_Id2], [c2].[Level3_Required_Id1], [c2].[Level3_Required_Id2], [c2].[Name], [c2].[OneToMany_Optional_Inverse4Id1], [c2].[OneToMany_Optional_Inverse4Id2], [c2].[OneToMany_Optional_Self_Inverse4Id1], [c2].[OneToMany_Optional_Self_Inverse4Id2], [c2].[OneToMany_Required_Inverse4Id1], [c2].[OneToMany_Required_Inverse4Id2], [c2].[OneToMany_Required_Self_Inverse4Id1], [c2].[OneToMany_Required_Self_Inverse4Id2], [c2].[OneToOne_Optional_PK_Inverse4Id1], [c2].[OneToOne_Optional_PK_Inverse4Id2], [c2].[OneToOne_Optional_Self4Id1], [c2].[OneToOne_Optional_Self4Id2], [c].[Id1], [c].[Id2], [c0].[Id1], [c0].[Id2], [c1].[Id1], [c1].[Id2] FROM [CompositeOnes] AS [c] INNER JOIN [CompositeTwos] AS [c0] ON [c].[Id1] = [c0].[OneToMany_Optional_Inverse2Id1] AND [c].[Id2] = [c0].[OneToMany_Optional_Inverse2Id2] @@ -208,14 +208,14 @@ FROM [CompositeOnes] AS [c] ORDER BY [c].[Name], [c].[Id1], [c].[Id2], [c0].[Id1], [c0].[Id2], [c1].[Id1], [c1].[Id2] """, // - """ +""" SELECT [c0].[Name], [c].[Id1], [c].[Id2], [c0].[Id1], [c0].[Id2] FROM [CompositeOnes] AS [c] INNER JOIN [CompositeTwos] AS [c0] ON [c].[Id1] = [c0].[OneToMany_Required_Inverse2Id1] AND [c].[Id2] = [c0].[OneToMany_Required_Inverse2Id2] ORDER BY [c].[Name], [c].[Id1], [c].[Id2], CAST(LEN([c0].[Name]) AS int), [c0].[Id1], [c0].[Id2] """, // - """ +""" SELECT [c1].[Name], [c].[Id1], [c].[Id2], [c0].[Id1], [c0].[Id2], [c1].[Id1], [c1].[Id2] FROM [CompositeOnes] AS [c] INNER JOIN [CompositeTwos] AS [c0] ON [c].[Id1] = [c0].[OneToMany_Required_Inverse2Id1] AND [c].[Id2] = [c0].[OneToMany_Required_Inverse2Id2] @@ -223,7 +223,7 @@ FROM [CompositeOnes] AS [c] ORDER BY [c].[Name], [c].[Id1], [c].[Id2], CAST(LEN([c0].[Name]) AS int), [c0].[Id1], [c0].[Id2], [c1].[Id1], [c1].[Id2] """, // - """ +""" SELECT [c2].[Id1], [c2].[Id2], [c2].[Level3_Optional_Id1], [c2].[Level3_Optional_Id2], [c2].[Level3_Required_Id1], [c2].[Level3_Required_Id2], [c2].[Name], [c2].[OneToMany_Optional_Inverse4Id1], [c2].[OneToMany_Optional_Inverse4Id2], [c2].[OneToMany_Optional_Self_Inverse4Id1], [c2].[OneToMany_Optional_Self_Inverse4Id2], [c2].[OneToMany_Required_Inverse4Id1], [c2].[OneToMany_Required_Inverse4Id2], [c2].[OneToMany_Required_Self_Inverse4Id1], [c2].[OneToMany_Required_Self_Inverse4Id2], [c2].[OneToOne_Optional_PK_Inverse4Id1], [c2].[OneToOne_Optional_PK_Inverse4Id2], [c2].[OneToOne_Optional_Self4Id1], [c2].[OneToOne_Optional_Self4Id2], [c].[Id1], [c].[Id2], [c0].[Id1], [c0].[Id2], [c1].[Id1], [c1].[Id2] FROM [CompositeOnes] AS [c] INNER JOIN [CompositeTwos] AS [c0] ON [c].[Id1] = [c0].[OneToMany_Required_Inverse2Id1] AND [c].[Id2] = [c0].[OneToMany_Required_Inverse2Id2] @@ -232,7 +232,7 @@ FROM [CompositeOnes] AS [c] ORDER BY [c].[Name], [c].[Id1], [c].[Id2], CAST(LEN([c0].[Name]) AS int), [c0].[Id1], [c0].[Id2], [c1].[Id1], [c1].[Id2] """, // - """ +""" SELECT [c2].[Id1], [c2].[Id2], [c2].[Level3_Optional_Id1], [c2].[Level3_Optional_Id2], [c2].[Level3_Required_Id1], [c2].[Level3_Required_Id2], [c2].[Name], [c2].[OneToMany_Optional_Inverse4Id1], [c2].[OneToMany_Optional_Inverse4Id2], [c2].[OneToMany_Optional_Self_Inverse4Id1], [c2].[OneToMany_Optional_Self_Inverse4Id2], [c2].[OneToMany_Required_Inverse4Id1], [c2].[OneToMany_Required_Inverse4Id2], [c2].[OneToMany_Required_Self_Inverse4Id1], [c2].[OneToMany_Required_Self_Inverse4Id2], [c2].[OneToOne_Optional_PK_Inverse4Id1], [c2].[OneToOne_Optional_PK_Inverse4Id2], [c2].[OneToOne_Optional_Self4Id1], [c2].[OneToOne_Optional_Self4Id2], [c].[Id1], [c].[Id2], [c0].[Id1], [c0].[Id2], [c1].[Id1], [c1].[Id2] FROM [CompositeOnes] AS [c] INNER JOIN [CompositeTwos] AS [c0] ON [c].[Id1] = [c0].[OneToMany_Required_Inverse2Id1] AND [c].[Id2] = [c0].[OneToMany_Required_Inverse2Id2] @@ -241,7 +241,7 @@ FROM [CompositeOnes] AS [c] ORDER BY [c].[Name], [c].[Id1], [c].[Id2], CAST(LEN([c0].[Name]) AS int), [c0].[Id1], [c0].[Id2], [c1].[Id1], [c1].[Id2] """, // - """ +""" SELECT [c1].[Name], [c].[Id1], [c].[Id2], [c0].[Id1], [c0].[Id2], [c1].[Id1], [c1].[Id2] FROM [CompositeOnes] AS [c] INNER JOIN [CompositeTwos] AS [c0] ON [c].[Id1] = [c0].[OneToMany_Required_Inverse2Id1] AND [c].[Id2] = [c0].[OneToMany_Required_Inverse2Id2] @@ -249,7 +249,7 @@ FROM [CompositeOnes] AS [c] ORDER BY [c].[Name], [c].[Id1], [c].[Id2], CAST(LEN([c0].[Name]) AS int), [c0].[Id1], [c0].[Id2], [c1].[Id1], [c1].[Id2] """, // - """ +""" SELECT [c2].[Id1], [c2].[Id2], [c2].[Level3_Optional_Id1], [c2].[Level3_Optional_Id2], [c2].[Level3_Required_Id1], [c2].[Level3_Required_Id2], [c2].[Name], [c2].[OneToMany_Optional_Inverse4Id1], [c2].[OneToMany_Optional_Inverse4Id2], [c2].[OneToMany_Optional_Self_Inverse4Id1], [c2].[OneToMany_Optional_Self_Inverse4Id2], [c2].[OneToMany_Required_Inverse4Id1], [c2].[OneToMany_Required_Inverse4Id2], [c2].[OneToMany_Required_Self_Inverse4Id1], [c2].[OneToMany_Required_Self_Inverse4Id2], [c2].[OneToOne_Optional_PK_Inverse4Id1], [c2].[OneToOne_Optional_PK_Inverse4Id2], [c2].[OneToOne_Optional_Self4Id1], [c2].[OneToOne_Optional_Self4Id2], [c].[Id1], [c].[Id2], [c0].[Id1], [c0].[Id2], [c1].[Id1], [c1].[Id2] FROM [CompositeOnes] AS [c] INNER JOIN [CompositeTwos] AS [c0] ON [c].[Id1] = [c0].[OneToMany_Required_Inverse2Id1] AND [c].[Id2] = [c0].[OneToMany_Required_Inverse2Id2] @@ -258,13 +258,13 @@ FROM [CompositeOnes] AS [c] ORDER BY [c].[Name], [c].[Id1], [c].[Id2], CAST(LEN([c0].[Name]) AS int), [c0].[Id1], [c0].[Id2], [c1].[Id1], [c1].[Id2] """, // - """ +""" SELECT [c2].[Id1], [c2].[Id2], [c2].[Level3_Optional_Id1], [c2].[Level3_Optional_Id2], [c2].[Level3_Required_Id1], [c2].[Level3_Required_Id2], [c2].[Name], [c2].[OneToMany_Optional_Inverse4Id1], [c2].[OneToMany_Optional_Inverse4Id2], [c2].[OneToMany_Optional_Self_Inverse4Id1], [c2].[OneToMany_Optional_Self_Inverse4Id2], [c2].[OneToMany_Required_Inverse4Id1], [c2].[OneToMany_Required_Inverse4Id2], [c2].[OneToMany_Required_Self_Inverse4Id1], [c2].[OneToMany_Required_Self_Inverse4Id2], [c2].[OneToOne_Optional_PK_Inverse4Id1], [c2].[OneToOne_Optional_PK_Inverse4Id2], [c2].[OneToOne_Optional_Self4Id1], [c2].[OneToOne_Optional_Self4Id2], [c].[Id1], [c].[Id2], [c0].[Id1], [c0].[Id2], [c1].[Id1], [c1].[Id2] FROM [CompositeOnes] AS [c] INNER JOIN [CompositeTwos] AS [c0] ON [c].[Id1] = [c0].[OneToMany_Required_Inverse2Id1] AND [c].[Id2] = [c0].[OneToMany_Required_Inverse2Id2] INNER JOIN [CompositeThrees] AS [c1] ON [c0].[Id1] = [c1].[OneToMany_Optional_Inverse3Id1] AND [c0].[Id2] = [c1].[OneToMany_Optional_Inverse3Id2] INNER JOIN [CompositeFours] AS [c2] ON [c1].[Id1] = [c2].[OneToMany_Required_Inverse4Id1] AND [c1].[Id2] = [c2].[OneToMany_Required_Inverse4Id2] -ORDER BY [c].[Name], [c].[Id1], [c].[Id2], CAST(LEN([c0].[Name]) AS int), [c0].[Id1], [c0].[Id2], [c1].[Id1], [c1].[Id2], [c2].[Id1] + CAST([c2].[Id2] AS nvarchar(450)) DESC +ORDER BY [c].[Name], [c].[Id1], [c].[Id2], CAST(LEN([c0].[Name]) AS int), [c0].[Id1], [c0].[Id2], [c1].[Id1], [c1].[Id2], [c2].[Id1] + CAST([c2].[Id2] AS nvarchar(max)) DESC """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/Ef6GroupBySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/Ef6GroupBySqlServerTest.cs index bd8a66fabf7..1e47c128b6e 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/Ef6GroupBySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/Ef6GroupBySqlServerTest.cs @@ -507,7 +507,7 @@ public override async Task Whats_new_2021_sample_3(bool async) await base.Whats_new_2021_sample_3(async); AssertSql( -""" + """ SELECT ( SELECT TOP(1) [p1].[LastName] FROM [Person] AS [p1] @@ -537,7 +537,7 @@ public override async Task Whats_new_2021_sample_5(bool async) await base.Whats_new_2021_sample_5(async); AssertSql( -""" + """ SELECT ( SELECT TOP(1) [p1].[LastName] FROM [Person] AS [p1] @@ -566,7 +566,7 @@ public override async Task Whats_new_2021_sample_6(bool async) await base.Whats_new_2021_sample_6(async); AssertSql( -""" + """ SELECT ( SELECT TOP(1) [p1].[MiddleInitial] FROM [Person] AS [p1] diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/FunkyDataQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/FunkyDataQuerySqlServerTest.cs index 38a585c3f90..34894f1f2f6 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/FunkyDataQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/FunkyDataQuerySqlServerTest.cs @@ -168,7 +168,7 @@ public override async Task String_starts_with_on_argument_with_wildcard_constant await base.String_starts_with_on_argument_with_wildcard_constant(async); AssertSql( -""" + """ SELECT [f].[FirstName] FROM [FunkyCustomers] AS [f] WHERE [f].[FirstName] LIKE N'\%B%' ESCAPE N'\' @@ -366,7 +366,7 @@ public override async Task String_ends_with_on_argument_with_wildcard_constant(b await base.String_ends_with_on_argument_with_wildcard_constant(async); AssertSql( -""" + """ SELECT [f].[FirstName] FROM [FunkyCustomers] AS [f] WHERE [f].[FirstName] LIKE N'%\%r' ESCAPE N'\' diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/GearsOfWarQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/GearsOfWarQuerySqlServerTest.cs index 07fb2733a24..424acc87161 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/GearsOfWarQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/GearsOfWarQuerySqlServerTest.cs @@ -2149,15 +2149,15 @@ WHERE [c].[Location] LIKE '%Jacinto%' """); } - public override async Task Non_unicode_string_literals_is_used_for_non_unicode_column_with_concat(bool async) + public override async Task Unicode_string_literals_is_used_for_non_unicode_column_with_concat(bool async) { - await base.Non_unicode_string_literals_is_used_for_non_unicode_column_with_concat(async); + await base.Unicode_string_literals_is_used_for_non_unicode_column_with_concat(async); AssertSql( """ SELECT [c].[Name], [c].[Location], [c].[Nation] FROM [Cities] AS [c] -WHERE COALESCE([c].[Location], '') + 'Added' LIKE '%Add%' +WHERE COALESCE([c].[Location], N'') + N'Added' LIKE N'%Add%' """); } @@ -3102,7 +3102,7 @@ public override async Task Contains_with_local_nullable_guid_list_closure(bool a await base.Contains_with_local_nullable_guid_list_closure(async); AssertSql( -""" + """ @__ids_0='["df36f493-463f-4123-83f9-6b135deeb7ba","23cbcf9b-ce14-45cf-aafa-2c2667ebfdd3","ab1b82d7-88db-42bd-a132-7eef9aa68af4"]' (Size = 4000) SELECT [t].[Id], [t].[GearNickName], [t].[GearSquadId], [t].[IssueDate], [t].[Note] @@ -7431,7 +7431,7 @@ public override async Task FirstOrDefault_navigation_access_entity_equality_in_w await base.FirstOrDefault_navigation_access_entity_equality_in_where_predicate_apply_peneding_selector(async); AssertSql( -""" + """ 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] LEFT JOIN [Cities] AS [c] ON [g].[AssignedCityName] = [c].[Name] @@ -7682,7 +7682,7 @@ public override async Task Conditional_expression_with_test_being_simplified_to_ await base.Conditional_expression_with_test_being_simplified_to_constant_complex(isAsync); AssertSql( -""" + """ @__prm_0='True' @__prm2_1='Marcus' Lancer' (Size = 4000) @@ -8324,7 +8324,7 @@ public override async Task FirstOrDefault_over_int_compared_to_zero(bool async) await base.FirstOrDefault_over_int_compared_to_zero(async); AssertSql( -""" + """ SELECT [s].[Name] FROM [Squads] AS [s] WHERE [s].[Name] = N'Delta' AND COALESCE(( @@ -9411,7 +9411,7 @@ public override async Task Parameter_used_multiple_times_take_appropriate_inferr await base.Parameter_used_multiple_times_take_appropriate_inferred_type_mapping(async); AssertSql( -""" + """ @__place_0='Ephyra's location' (Size = 4000), @__place_0_1='Ephyra's location' (Size = 100) (DbType = AnsiString) SELECT [c].[Name], [c].[Location], [c].[Nation] @@ -9906,7 +9906,7 @@ public override async Task Where_subquery_equality_to_null_with_composite_key_sh await base.Where_subquery_equality_to_null_with_composite_key_should_match_nulls(async); AssertSql( -""" + """ SELECT [s].[Id], [s].[Banner], [s].[Banner5], [s].[InternalNumber], [s].[Name] FROM [Squads] AS [s] WHERE NOT EXISTS ( @@ -9936,7 +9936,7 @@ public override async Task Where_subquery_equality_to_null_without_composite_key await base.Where_subquery_equality_to_null_without_composite_key_should_match_null(async); AssertSql( -""" + """ 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 NOT EXISTS ( @@ -10159,7 +10159,7 @@ public override async Task Nav_expansion_inside_Contains_argument(bool async) await base.Nav_expansion_inside_Contains_argument(async); AssertSql( -""" + """ @__numbers_0='[1,-1]' (Size = 4000) SELECT [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOfBirthName], [g].[Discriminator], [g].[FullName], [g].[HasSoulPatch], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[Rank] @@ -10182,7 +10182,7 @@ public override async Task Nav_expansion_with_member_pushdown_inside_Contains_ar await base.Nav_expansion_with_member_pushdown_inside_Contains_argument(async); AssertSql( -""" + """ @__weapons_0='["Marcus\u0027 Lancer","Dom\u0027s Gnasher"]' (Size = 4000) SELECT [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOfBirthName], [g].[Discriminator], [g].[FullName], [g].[HasSoulPatch], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[Rank] @@ -10207,7 +10207,7 @@ public override async Task Subquery_inside_Take_argument(bool async) await base.Subquery_inside_Take_argument(async); AssertSql( -""" + """ @__numbers_0='[0,1,2]' (Size = 4000) SELECT [g].[Nickname], [g].[SquadId], [t0].[Id], [t0].[AmmunitionType], [t0].[IsAutomatic], [t0].[Name], [t0].[OwnerFullName], [t0].[SynergyWithId] diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/JsonQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/JsonQuerySqlServerTest.cs index 156daebb299..033bc798c04 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/JsonQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/JsonQuerySqlServerTest.cs @@ -1006,7 +1006,7 @@ public override async Task Json_collection_Any_with_predicate(bool async) await base.Json_collection_Any_with_predicate(async); AssertSql( -""" + """ SELECT [j].[Id], [j].[EntityBasicId], [j].[Name], [j].[OwnedCollectionRoot], [j].[OwnedReferenceRoot] FROM [JsonEntitiesBasic] AS [j] WHERE EXISTS ( @@ -1870,7 +1870,7 @@ public override async Task Json_scalar_optional_null_semantics(bool async) await base.Json_scalar_optional_null_semantics(async); AssertSql( -""" + """ SELECT [j].[Name] FROM [JsonEntitiesBasic] AS [j] WHERE (JSON_VALUE([j].[OwnedReferenceRoot], '$.Name') <> JSON_VALUE([j].[OwnedReferenceRoot], '$.OwnedReferenceBranch.OwnedReferenceLeaf.SomethingSomething') OR JSON_VALUE([j].[OwnedReferenceRoot], '$.Name') IS NULL OR JSON_VALUE([j].[OwnedReferenceRoot], '$.OwnedReferenceBranch.OwnedReferenceLeaf.SomethingSomething') IS NULL) AND (JSON_VALUE([j].[OwnedReferenceRoot], '$.Name') IS NOT NULL OR JSON_VALUE([j].[OwnedReferenceRoot], '$.OwnedReferenceBranch.OwnedReferenceLeaf.SomethingSomething') IS NOT NULL) diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindAggregateOperatorsQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindAggregateOperatorsQuerySqlServerTest.cs index 3f1bf17251e..7fd60b406fd 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindAggregateOperatorsQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindAggregateOperatorsQuerySqlServerTest.cs @@ -1798,7 +1798,7 @@ public override async Task Contains_with_local_enumerable_closure(bool async) await base.Contains_with_local_enumerable_closure(async); AssertSql( -""" + """ @__ids_0='["ABCDE","ALFKI"]' (Size = 4000) SELECT [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region] @@ -1826,7 +1826,7 @@ public override async Task Contains_with_local_object_enumerable_closure(bool as await base.Contains_with_local_object_enumerable_closure(async); AssertSql( -""" + """ @__ids_0='["ABCDE","ALFKI"]' (Size = 4000) SELECT [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region] @@ -1843,7 +1843,7 @@ public override async Task Contains_with_local_enumerable_closure_all_null(bool await base.Contains_with_local_enumerable_closure_all_null(async); AssertSql( -""" + """ @__ids_0='[]' (Size = 4000) SELECT [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region] @@ -1880,7 +1880,7 @@ public override async Task Contains_with_local_ordered_enumerable_closure(bool a await base.Contains_with_local_ordered_enumerable_closure(async); AssertSql( -""" + """ @__ids_0='["ABCDE","ALFKI"]' (Size = 4000) SELECT [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region] @@ -1908,7 +1908,7 @@ public override async Task Contains_with_local_object_ordered_enumerable_closure await base.Contains_with_local_object_ordered_enumerable_closure(async); AssertSql( -""" + """ @__ids_0='["ABCDE","ALFKI"]' (Size = 4000) SELECT [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region] @@ -1925,7 +1925,7 @@ public override async Task Contains_with_local_ordered_enumerable_closure_all_nu await base.Contains_with_local_ordered_enumerable_closure_all_null(async); AssertSql( -""" + """ @__ids_0='[null,null]' (Size = 4000) SELECT [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region] @@ -1942,7 +1942,7 @@ public override async Task Contains_with_local_ordered_enumerable_inline(bool as await base.Contains_with_local_ordered_enumerable_inline(async); AssertSql( -""" + """ 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] WHERE [c].[CustomerID] IN (N'ABCDE', N'ALFKI') @@ -1954,7 +1954,7 @@ public override async Task Contains_with_local_ordered_enumerable_inline_closure await base.Contains_with_local_ordered_enumerable_inline_closure_mix(async); AssertSql( -""" + """ @__Order_0='["ABCDE","ALFKI"]' (Size = 4000) SELECT [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region] @@ -1982,7 +1982,7 @@ public override async Task Contains_with_local_read_only_collection_closure(bool await base.Contains_with_local_read_only_collection_closure(async); AssertSql( -""" + """ 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] WHERE [c].[CustomerID] IN (N'ABCDE', N'ALFKI') @@ -2000,7 +2000,7 @@ public override async Task Contains_with_local_object_read_only_collection_closu await base.Contains_with_local_object_read_only_collection_closure(async); AssertSql( -""" + """ 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] WHERE [c].[CustomerID] IN (N'ABCDE', N'ALFKI') @@ -2012,7 +2012,7 @@ public override async Task Contains_with_local_ordered_read_only_collection_all_ await base.Contains_with_local_ordered_read_only_collection_all_null(async); AssertSql( -""" + """ 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] WHERE 0 = 1 @@ -2024,7 +2024,7 @@ public override async Task Contains_with_local_read_only_collection_inline(bool await base.Contains_with_local_read_only_collection_inline(async); AssertSql( -""" + """ 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] WHERE [c].[CustomerID] IN (N'ABCDE', N'ALFKI') @@ -2036,7 +2036,7 @@ public override async Task Contains_with_local_read_only_collection_inline_closu await base.Contains_with_local_read_only_collection_inline_closure_mix(async); AssertSql( -""" + """ 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] WHERE [c].[CustomerID] IN (N'ABCDE', N'ALFKI') diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindDbFunctionsQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindDbFunctionsQuerySqlServerTest.cs index d7cee418c9e..2f44080e1c5 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindDbFunctionsQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindDbFunctionsQuerySqlServerTest.cs @@ -841,7 +841,7 @@ await AssertCount( """ SELECT COUNT(*) FROM [Orders] AS [o] -WHERE CAST(ISDATE(COALESCE([o].[CustomerID], N'') + CAST([o].[OrderID] AS nchar(5))) AS bit) = CAST(1 AS bit) +WHERE CAST(ISDATE(COALESCE([o].[CustomerID], N'') + CAST([o].[OrderID] AS nvarchar(max))) AS bit) = CAST(1 AS bit) """); } @@ -914,7 +914,7 @@ await AssertCount( """ SELECT COUNT(*) FROM [Orders] AS [o] -WHERE ISNUMERIC(COALESCE([o].[CustomerID], N'') + CAST([o].[OrderID] AS nchar(5))) = 1 +WHERE ISNUMERIC(COALESCE([o].[CustomerID], N'') + CAST([o].[OrderID] AS nvarchar(max))) = 1 """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindFunctionsQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindFunctionsQuerySqlServerTest.cs index 2b013403766..696f0ecd03f 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindFunctionsQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindFunctionsQuerySqlServerTest.cs @@ -378,7 +378,7 @@ public override async Task String_Compare_simple_zero(bool async) await base.String_Compare_simple_zero(async); AssertSql( -""" + """ 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] WHERE [c].[CustomerID] = N'AROUT' @@ -420,7 +420,7 @@ public override async Task String_Compare_simple_one(bool async) await base.String_Compare_simple_one(async); AssertSql( -""" + """ 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] WHERE [c].[CustomerID] > N'AROUT' @@ -462,7 +462,7 @@ public override async Task String_compare_with_parameter(bool async) await base.String_compare_with_parameter(async); AssertSql( -""" + """ @__customer_CustomerID_0='AROUT' (Size = 5) (DbType = StringFixedLength) SELECT [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region] @@ -612,7 +612,7 @@ public override async Task String_Compare_to_simple_zero(bool async) await base.String_Compare_to_simple_zero(async); AssertSql( -""" + """ 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] WHERE [c].[CustomerID] = N'AROUT' @@ -654,7 +654,7 @@ public override async Task String_Compare_to_simple_one(bool async) await base.String_Compare_to_simple_one(async); AssertSql( -""" + """ 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] WHERE [c].[CustomerID] > N'AROUT' @@ -696,7 +696,7 @@ public override async Task String_compare_to_with_parameter(bool async) await base.String_compare_to_with_parameter(async); AssertSql( -""" + """ @__customer_CustomerID_0='AROUT' (Size = 5) (DbType = StringFixedLength) SELECT [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region] @@ -786,7 +786,7 @@ public override async Task String_Compare_to_nested(bool async) await base.String_Compare_to_nested(async); AssertSql( -""" + """ 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] WHERE [c].[CustomerID] <> N'M' + [c].[CustomerID] diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindJoinQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindJoinQuerySqlServerTest.cs index 4108c4cc4cc..074adb38cfa 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindJoinQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindJoinQuerySqlServerTest.cs @@ -129,7 +129,7 @@ public override async Task Join_customers_orders_with_subquery_anonymous_propert await base.Join_customers_orders_with_subquery_anonymous_property_method_with_take(async); AssertSql( -""" + """ @__p_0='5' SELECT [t].[OrderID], [t].[CustomerID], [t].[EmployeeID], [t].[OrderDate] diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindMiscellaneousQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindMiscellaneousQuerySqlServerTest.cs index 562ef7639e2..32053136199 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindMiscellaneousQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindMiscellaneousQuerySqlServerTest.cs @@ -666,7 +666,7 @@ public override async Task Where_query_composition_entity_equality_multiple_elem await base.Where_query_composition_entity_equality_multiple_elements_SingleOrDefault(async); AssertSql( -""" + """ SELECT [e].[EmployeeID], [e].[City], [e].[Country], [e].[FirstName], [e].[ReportsTo], [e].[Title] FROM [Employees] AS [e] WHERE ( @@ -1515,7 +1515,7 @@ public override async Task Any_nested_negated2(bool async) await base.Any_nested_negated2(async); AssertSql( -""" + """ 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] WHERE ([c].[City] <> N'London' OR [c].[City] IS NULL) AND NOT EXISTS ( @@ -1530,7 +1530,7 @@ public override async Task Any_nested_negated3(bool async) await base.Any_nested_negated3(async); AssertSql( -""" + """ 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] WHERE NOT EXISTS ( @@ -1883,7 +1883,7 @@ public override async Task Where_Join_Any(bool async) await base.Where_Join_Any(async); AssertSql( -""" + """ 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] WHERE [c].[CustomerID] LIKE N'A%' AND EXISTS ( @@ -3057,7 +3057,7 @@ public override async Task Concat_string_int(bool async) AssertSql( """ -SELECT CAST([o].[OrderID] AS nchar(5)) + COALESCE([o].[CustomerID], N'') +SELECT CAST([o].[OrderID] AS nvarchar(max)) + COALESCE([o].[CustomerID], N'') FROM [Orders] AS [o] """); } @@ -3068,7 +3068,7 @@ public override async Task Concat_int_string(bool async) AssertSql( """ -SELECT COALESCE([o].[CustomerID], N'') + CAST([o].[OrderID] AS nchar(5)) +SELECT COALESCE([o].[CustomerID], N'') + CAST([o].[OrderID] AS nvarchar(max)) FROM [Orders] AS [o] """); } @@ -3480,7 +3480,7 @@ public override async Task Query_expression_with_to_string_and_contains(bool asy await base.Query_expression_with_to_string_and_contains(async); AssertSql( -""" + """ SELECT [o].[CustomerID] FROM [Orders] AS [o] WHERE [o].[OrderDate] IS NOT NULL AND CONVERT(varchar(10), [o].[EmployeeID]) LIKE N'%7%' @@ -3725,7 +3725,7 @@ public override async Task DefaultIfEmpty_in_subquery_nested(bool async) await base.DefaultIfEmpty_in_subquery_nested(async); AssertSql( -""" + """ SELECT [c].[CustomerID], [t0].[OrderID], [o0].[OrderDate] FROM [Customers] AS [c] CROSS JOIN ( @@ -3750,7 +3750,7 @@ public override async Task DefaultIfEmpty_in_subquery_nested_filter_order_compar await base.DefaultIfEmpty_in_subquery_nested_filter_order_comparison(async); AssertSql( -""" + """ SELECT [c].[CustomerID], [t0].[OrderID], [t1].[OrderDate] FROM [Customers] AS [c] CROSS JOIN ( @@ -5733,7 +5733,7 @@ public override async Task Select_distinct_Select_with_client_bindings(bool asyn await base.Select_distinct_Select_with_client_bindings(async); AssertSql( -""" + """ SELECT [t].[c] FROM ( SELECT DISTINCT DATEPART(year, [o].[OrderDate]) AS [c] @@ -7316,6 +7316,90 @@ FROM OPENJSON(@__ids_0) WITH ([value] int '$') AS [i0] ) AND [o].[Quantity] = [o2].[Quantity]) """); #endif + } + + public override async Task Contains_over_concatenated_columns_with_different_sizes(bool async) + { + await base.Contains_over_concatenated_columns_with_different_sizes (async); + + AssertSql( + """ +@__data_0='["ALFKIAlfreds Futterkiste","ANATRAna Trujillo Emparedados y helados"]' (Size = 4000) + +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] +WHERE [c].[CustomerID] + [c].[CompanyName] IN ( + SELECT [d].[value] + FROM OPENJSON(@__data_0) WITH ([value] nvarchar(45) '$') AS [d] +) +"""); + } + + public override async Task Contains_over_concatenated_column_and_constant(bool async) + { + await base.Contains_over_concatenated_column_and_constant (async); + + AssertSql( + """ +@__data_0='["ALFKISomeConstant","ANATRSomeConstant","ALFKIX"]' (Size = 4000) + +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] +WHERE [c].[CustomerID] + N'SomeConstant' IN ( + SELECT [d].[value] + FROM OPENJSON(@__data_0) WITH ([value] nvarchar(max) '$') AS [d] +) +"""); + } + + public override async Task Contains_over_concatenated_columns_both_fixed_length(bool async) + { + await base.Contains_over_concatenated_columns_both_fixed_length(async); + + AssertSql( + """ +@__data_0='["ALFKIALFKI","ALFKI","ANATRAna Trujillo Emparedados y helados","ANATRANATR"]' (Size = 4000) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate] +FROM [Orders] AS [o] +LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] +WHERE COALESCE([o].[CustomerID], N'') + COALESCE([c].[CustomerID], N'') IN ( + SELECT [d].[value] + FROM OPENJSON(@__data_0) WITH ([value] nchar(10) '$') AS [d] +) +"""); + } + + public override async Task Contains_over_concatenated_column_and_parameter(bool async) + { + await base.Contains_over_concatenated_column_and_parameter(async); + + AssertSql( + """ +@__someVariable_1='SomeVariable' (Size = 4000) +@__data_0='["ALFKISomeVariable","ANATRSomeVariable","ALFKIX"]' (Size = 4000) + +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] +WHERE [c].[CustomerID] + @__someVariable_1 IN ( + SELECT [d].[value] + FROM OPENJSON(@__data_0) WITH ([value] nvarchar(max) '$') AS [d] +) +"""); + } + + public override async Task Contains_over_concatenated_parameter_and_constant(bool async) + { + await base.Contains_over_concatenated_parameter_and_constant(async); + + AssertSql( + """ +@__Contains_0='True' + +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] +WHERE @__Contains_0 = CAST(1 AS bit) +"""); } private void AssertSql(params string[] expected) diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindSetOperationsQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindSetOperationsQuerySqlServerTest.cs index e797f7ae4dc..ded5240008b 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindSetOperationsQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindSetOperationsQuerySqlServerTest.cs @@ -278,7 +278,7 @@ public override async Task Union_Select_scalar(bool async) await base.Union_Select_scalar(async); AssertSql( -""" + """ SELECT 1 FROM ( SELECT [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region] diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindWhereQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindWhereQuerySqlServerTest.cs index 387cdc5b1bf..b1aaa22dece 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindWhereQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindWhereQuerySqlServerTest.cs @@ -1010,7 +1010,7 @@ public override async Task Where_datetimeoffset_now_component(bool async) await base.Where_datetimeoffset_now_component(async); AssertSql( -""" + """ SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate] FROM [Orders] AS [o] WHERE CAST([o].[OrderDate] AS datetimeoffset) < SYSDATETIMEOFFSET() @@ -1022,7 +1022,7 @@ public override async Task Where_datetimeoffset_utcnow_component(bool async) await base.Where_datetimeoffset_utcnow_component(async); AssertSql( -""" + """ SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate] FROM [Orders] AS [o] WHERE CAST([o].[OrderDate] AS datetimeoffset) <> CAST(SYSUTCDATETIME() AS datetimeoffset) OR [o].[OrderDate] IS NULL @@ -1046,7 +1046,7 @@ public override async Task Where_is_null(bool async) await base.Where_is_null(async); AssertSql( -""" + """ 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] WHERE [c].[Region] IS NULL @@ -1554,7 +1554,7 @@ public override async Task Where_concat_string_int_comparison1(bool async) SELECT [c].[CustomerID] FROM [Customers] AS [c] -WHERE [c].[CustomerID] + CAST(@__i_0 AS nchar(5)) = [c].[CompanyName] +WHERE [c].[CustomerID] + CAST(@__i_0 AS nvarchar(max)) = [c].[CompanyName] """); } @@ -1568,7 +1568,7 @@ public override async Task Where_concat_string_int_comparison2(bool async) SELECT [c].[CustomerID] FROM [Customers] AS [c] -WHERE CAST(@__i_0 AS nchar(5)) + [c].[CustomerID] = [c].[CompanyName] +WHERE CAST(@__i_0 AS nvarchar(max)) + [c].[CustomerID] = [c].[CompanyName] """); } @@ -1583,7 +1583,7 @@ public override async Task Where_concat_string_int_comparison3(bool async) SELECT [c].[CustomerID] FROM [Customers] AS [c] -WHERE CAST(@__p_0 AS nchar(5)) + [c].[CustomerID] + CAST(@__j_1 AS nchar(5)) + CAST(42 AS nchar(5)) = [c].[CompanyName] +WHERE CAST(@__p_0 AS nvarchar(max)) + [c].[CustomerID] + CAST(@__j_1 AS nvarchar(max)) + CAST(42 AS nvarchar(max)) = [c].[CompanyName] """); } @@ -1595,7 +1595,7 @@ public override async Task Where_concat_string_int_comparison4(bool async) """ SELECT [o].[CustomerID] FROM [Orders] AS [o] -WHERE CAST([o].[OrderID] AS nchar(5)) + COALESCE([o].[CustomerID], N'') = [o].[CustomerID] +WHERE CAST([o].[OrderID] AS nvarchar(max)) + COALESCE([o].[CustomerID], N'') = [o].[CustomerID] """); } @@ -1604,8 +1604,8 @@ public override async Task Where_concat_string_string_comparison(bool async) await base.Where_concat_string_string_comparison(async); AssertSql( -""" -@__i_0='A' (Size = 5) + """ +@__i_0='A' (Size = 4000) SELECT [c].[CustomerID] FROM [Customers] AS [c] @@ -1618,8 +1618,8 @@ public override async Task Where_string_concat_method_comparison(bool async) await base.Where_string_concat_method_comparison(async); AssertSql( -""" -@__i_0='A' (Size = 5) + """ +@__i_0='A' (Size = 4000) SELECT [c].[CustomerID] FROM [Customers] AS [c] @@ -1632,9 +1632,9 @@ public override async Task Where_string_concat_method_comparison_2(bool async) await base.Where_string_concat_method_comparison_2(async); AssertSql( -""" -@__i_0='A' (Size = 5) -@__j_1='B' (Size = 5) + """ +@__i_0='A' (Size = 4000) +@__j_1='B' (Size = 4000) SELECT [c].[CustomerID] FROM [Customers] AS [c] @@ -1647,10 +1647,10 @@ public override async Task Where_string_concat_method_comparison_3(bool async) await base.Where_string_concat_method_comparison_3(async); AssertSql( -""" -@__i_0='A' (Size = 5) -@__j_1='B' (Size = 5) -@__k_2='C' (Size = 5) + """ +@__i_0='A' (Size = 4000) +@__j_1='B' (Size = 4000) +@__k_2='C' (Size = 4000) SELECT [c].[CustomerID] FROM [Customers] AS [c] @@ -1797,7 +1797,7 @@ public override async Task Where_compare_null(bool async) await base.Where_compare_null(async); AssertSql( -""" + """ 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] WHERE [c].[Region] IS NULL AND [c].[Country] = N'UK' @@ -1809,7 +1809,7 @@ public override async Task Where_compare_null_with_cast_to_object(bool async) await base.Where_compare_null_with_cast_to_object(async); AssertSql( -""" + """ 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] WHERE [c].[Region] IS NULL @@ -2021,7 +2021,7 @@ public override async Task Enclosing_class_settable_member_generates_parameter(b await base.Enclosing_class_settable_member_generates_parameter(async); AssertSql( -""" + """ @__SettableProperty_0='10274' SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate] @@ -2043,7 +2043,7 @@ public override async Task Enclosing_class_readonly_member_generates_parameter(b await base.Enclosing_class_readonly_member_generates_parameter(async); AssertSql( -""" + """ @__ReadOnlyProperty_0='10275' SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate] @@ -2057,7 +2057,7 @@ public override async Task Enclosing_class_const_member_does_not_generate_parame await base.Enclosing_class_const_member_does_not_generate_parameter(async); AssertSql( -""" + """ SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate] FROM [Orders] AS [o] WHERE [o].[OrderID] = 10274 @@ -2126,7 +2126,7 @@ public override async Task Using_same_parameter_twice_in_query_generates_one_sql await base.Using_same_parameter_twice_in_query_generates_one_sql_parameter(async); AssertSql( -""" + """ @__i_0='10' SELECT [c].[CustomerID] @@ -2918,7 +2918,7 @@ public override async Task Where_Contains_and_comparison(bool async) await base.Where_Contains_and_comparison(async); AssertSql( -""" + """ @__customerIds_0='["ALFKI","FISSA","WHITC"]' (Size = 4000) SELECT [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region] diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/NullSemanticsQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/NullSemanticsQuerySqlServerTest.cs index 4352edd7d4c..a5399295e23 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/NullSemanticsQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/NullSemanticsQuerySqlServerTest.cs @@ -1997,7 +1997,7 @@ public override async Task Null_semantics_contains_nullable_item_with_nullable_s await base.Null_semantics_contains_nullable_item_with_nullable_subquery(async); AssertSql( -""" + """ SELECT [e].[Id] FROM [Entities1] AS [e] WHERE EXISTS ( diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/OptionalDependentQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/OptionalDependentQuerySqlServerTest.cs index 136aee2ec5b..1991c7ec441 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/OptionalDependentQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/OptionalDependentQuerySqlServerTest.cs @@ -16,7 +16,7 @@ public override async Task Basic_projection_entity_with_all_optional(bool async) await base.Basic_projection_entity_with_all_optional(async); AssertSql( -""" + """ SELECT [e].[Id], [e].[Name], [e].[Json] FROM [EntitiesAllOptional] AS [e] """); @@ -27,7 +27,7 @@ public override async Task Basic_projection_entity_with_some_required(bool async await base.Basic_projection_entity_with_some_required(async); AssertSql( -""" + """ SELECT [e].[Id], [e].[Name], [e].[Json] FROM [EntitiesSomeRequired] AS [e] """); @@ -38,7 +38,7 @@ public override async Task Filter_optional_dependent_with_all_optional_compared_ await base.Filter_optional_dependent_with_all_optional_compared_to_null(async); AssertSql( -""" + """ SELECT [e].[Id], [e].[Name], [e].[Json] FROM [EntitiesAllOptional] AS [e] WHERE [e].[Json] IS NULL @@ -50,7 +50,7 @@ public override async Task Filter_optional_dependent_with_all_optional_compared_ await base.Filter_optional_dependent_with_all_optional_compared_to_not_null(async); AssertSql( -""" + """ SELECT [e].[Id], [e].[Name], [e].[Json] FROM [EntitiesAllOptional] AS [e] WHERE [e].[Json] IS NOT NULL @@ -62,7 +62,7 @@ public override async Task Filter_optional_dependent_with_some_required_compared await base.Filter_optional_dependent_with_some_required_compared_to_null(async); AssertSql( -""" + """ SELECT [e].[Id], [e].[Name], [e].[Json] FROM [EntitiesSomeRequired] AS [e] WHERE [e].[Json] IS NULL @@ -74,7 +74,7 @@ public override async Task Filter_optional_dependent_with_some_required_compared await base.Filter_optional_dependent_with_some_required_compared_to_not_null(async); AssertSql( -""" + """ SELECT [e].[Id], [e].[Name], [e].[Json] FROM [EntitiesSomeRequired] AS [e] WHERE [e].[Json] IS NOT NULL @@ -86,7 +86,7 @@ public override async Task Filter_nested_optional_dependent_with_all_optional_co await base.Filter_nested_optional_dependent_with_all_optional_compared_to_null(async); AssertSql( -""" + """ SELECT [e].[Id], [e].[Name], [e].[Json] FROM [EntitiesAllOptional] AS [e] WHERE JSON_QUERY([e].[Json], '$.OpNav1') IS NULL @@ -98,7 +98,7 @@ public override async Task Filter_nested_optional_dependent_with_all_optional_co await base.Filter_nested_optional_dependent_with_all_optional_compared_to_not_null(async); AssertSql( -""" + """ SELECT [e].[Id], [e].[Name], [e].[Json] FROM [EntitiesAllOptional] AS [e] WHERE JSON_QUERY([e].[Json], '$.OpNav2') IS NOT NULL @@ -110,7 +110,7 @@ public override async Task Filter_nested_optional_dependent_with_some_required_c await base.Filter_nested_optional_dependent_with_some_required_compared_to_null(async); AssertSql( -""" + """ SELECT [e].[Id], [e].[Name], [e].[Json] FROM [EntitiesSomeRequired] AS [e] WHERE JSON_QUERY([e].[Json], '$.ReqNav1') IS NULL @@ -122,7 +122,7 @@ public override async Task Filter_nested_optional_dependent_with_some_required_c await base.Filter_nested_optional_dependent_with_some_required_compared_to_not_null(async); AssertSql( -""" + """ SELECT [e].[Id], [e].[Name], [e].[Json] FROM [EntitiesSomeRequired] AS [e] WHERE JSON_QUERY([e].[Json], '$.ReqNav2') IS NOT NULL diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/OwnedEntityQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/OwnedEntityQuerySqlServerTest.cs index f0fb9c18c7c..3572e82e6dc 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/OwnedEntityQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/OwnedEntityQuerySqlServerTest.cs @@ -190,7 +190,7 @@ public override async Task Owned_entity_with_all_null_properties_in_compared_to_ await base.Owned_entity_with_all_null_properties_in_compared_to_non_null_in_conditional_projection(async); AssertSql( -""" + """ SELECT CASE WHEN [r].[Rot_ApartmentNo] IS NOT NULL OR [r].[Rot_ServiceType] IS NOT NULL THEN CAST(1 AS bit) ELSE CAST(0 AS bit) diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/SimpleQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/SimpleQuerySqlServerTest.cs index 12c84594423..47e6ce547ed 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/SimpleQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/SimpleQuerySqlServerTest.cs @@ -91,7 +91,7 @@ public virtual async Task TemporalAsOf_with_json_basic_query(bool async) Assert.True(result.All(x => x.Collection.Count > 0)); AssertSql( -""" + """ SELECT [e].[Id], [e].[Name], [e].[PeriodEnd], [e].[PeriodStart], [e].[Collection], [e].[Reference] FROM [Entities] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e] """); @@ -114,7 +114,7 @@ public virtual async Task TemporalAll_with_json_basic_query(bool async) Assert.True(result.All(x => x.Collection.Count > 0)); AssertSql( -""" + """ SELECT [e].[Id], [e].[Name], [e].[PeriodEnd], [e].[PeriodStart], [e].[Collection], [e].[Reference] FROM [Entities] FOR SYSTEM_TIME ALL AS [e] """); @@ -136,7 +136,7 @@ public virtual async Task TemporalAsOf_project_json_entity_reference(bool async) Assert.True(result.All(x => x != null)); AssertSql( -""" + """ SELECT [e].[Reference], [e].[Id] FROM [Entities] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e] """); @@ -158,7 +158,7 @@ public virtual async Task TemporalAsOf_project_json_entity_collection(bool async Assert.True(result.All(x => x.Count > 0)); AssertSql( -""" + """ SELECT [e].[Collection], [e].[Id] FROM [Entities] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e] """); @@ -814,7 +814,7 @@ public override async Task Filter_on_nested_DTO_with_interface_gets_simplified_c await base.Filter_on_nested_DTO_with_interface_gets_simplified_correctly(async); AssertSql( -""" + """ SELECT [c].[Id], [c].[CompanyId], CASE WHEN [c0].[Id] IS NOT NULL THEN CAST(1 AS bit) ELSE CAST(0 AS bit) diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/TPCGearsOfWarQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/TPCGearsOfWarQuerySqlServerTest.cs index d5ce36064db..7508469df16 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/TPCGearsOfWarQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/TPCGearsOfWarQuerySqlServerTest.cs @@ -2983,15 +2983,15 @@ WHERE [c].[Location] LIKE '%Jacinto%' """); } - public override async Task Non_unicode_string_literals_is_used_for_non_unicode_column_with_concat(bool async) + public override async Task Unicode_string_literals_is_used_for_non_unicode_column_with_concat(bool async) { - await base.Non_unicode_string_literals_is_used_for_non_unicode_column_with_concat(async); + await base.Unicode_string_literals_is_used_for_non_unicode_column_with_concat(async); AssertSql( """ SELECT [c].[Name], [c].[Location], [c].[Nation] FROM [Cities] AS [c] -WHERE COALESCE([c].[Location], '') + 'Added' LIKE '%Add%' +WHERE COALESCE([c].[Location], N'') + N'Added' LIKE N'%Add%' """); } @@ -4138,7 +4138,7 @@ public override async Task Contains_with_local_nullable_guid_list_closure(bool a await base.Contains_with_local_nullable_guid_list_closure(async); AssertSql( -""" + """ @__ids_0='["df36f493-463f-4123-83f9-6b135deeb7ba","23cbcf9b-ce14-45cf-aafa-2c2667ebfdd3","ab1b82d7-88db-42bd-a132-7eef9aa68af4"]' (Size = 4000) SELECT [t].[Id], [t].[GearNickName], [t].[GearSquadId], [t].[IssueDate], [t].[Note] @@ -9912,7 +9912,7 @@ public override async Task FirstOrDefault_navigation_access_entity_equality_in_w await base.FirstOrDefault_navigation_access_entity_equality_in_where_predicate_apply_peneding_selector(async); AssertSql( -""" + """ SELECT [t].[Nickname], [t].[SquadId], [t].[AssignedCityName], [t].[CityOfBirthName], [t].[FullName], [t].[HasSoulPatch], [t].[LeaderNickname], [t].[LeaderSquadId], [t].[Rank], [t].[Discriminator] FROM ( SELECT [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOfBirthName], [g].[FullName], [g].[HasSoulPatch], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[Rank], N'Gear' AS [Discriminator] @@ -10145,7 +10145,7 @@ public override async Task Byte_array_filter_by_length_parameter(bool async) await base.Byte_array_filter_by_length_parameter(async); AssertSql( -""" + """ @__p_0='2' SELECT [s].[Id], [s].[Banner], [s].[Banner5], [s].[InternalNumber], [s].[Name] @@ -10222,7 +10222,7 @@ public override async Task Conditional_expression_with_test_being_simplified_to_ await base.Conditional_expression_with_test_being_simplified_to_constant_complex(isAsync); AssertSql( -""" + """ @__prm_0='True' @__prm2_1='Marcus' Lancer' (Size = 4000) @@ -10398,7 +10398,7 @@ public override async Task Checked_context_with_addition_does_not_fail(bool isAs await base.Checked_context_with_addition_does_not_fail(isAsync); AssertSql( -""" + """ SELECT [t].[Name], [t].[LocustHordeId], [t].[ThreatLevel], [t].[ThreatLevelByte], [t].[ThreatLevelNullableByte], [t].[DefeatedByNickname], [t].[DefeatedBySquadId], [t].[HighCommandId], [t].[Discriminator] FROM ( SELECT [l].[Name], [l].[LocustHordeId], [l].[ThreatLevel], [l].[ThreatLevelByte], [l].[ThreatLevelNullableByte], NULL AS [DefeatedByNickname], NULL AS [DefeatedBySquadId], NULL AS [HighCommandId], N'LocustLeader' AS [Discriminator] @@ -11089,7 +11089,7 @@ public override async Task FirstOrDefault_over_int_compared_to_zero(bool async) await base.FirstOrDefault_over_int_compared_to_zero(async); AssertSql( -""" + """ SELECT [s].[Name] FROM [Squads] AS [s] WHERE [s].[Name] = N'Delta' AND COALESCE(( @@ -12005,7 +12005,7 @@ public override async Task Parameter_used_multiple_times_take_appropriate_inferr await base.Parameter_used_multiple_times_take_appropriate_inferred_type_mapping(async); AssertSql( -""" + """ @__place_0='Ephyra's location' (Size = 4000), @__place_0_1='Ephyra's location' (Size = 100) (DbType = AnsiString) SELECT [c].[Name], [c].[Location], [c].[Nation] @@ -13001,7 +13001,7 @@ public override async Task Where_subquery_equality_to_null_with_composite_key_sh await base.Where_subquery_equality_to_null_with_composite_key_should_match_nulls(async); AssertSql( -""" + """ SELECT [s].[Id], [s].[Banner], [s].[Banner5], [s].[InternalNumber], [s].[Name] FROM [Squads] AS [s] WHERE NOT EXISTS ( @@ -13043,7 +13043,7 @@ public override async Task Where_subquery_equality_to_null_without_composite_key await base.Where_subquery_equality_to_null_without_composite_key_should_match_null(async); AssertSql( -""" + """ SELECT [t].[Nickname], [t].[SquadId], [t].[AssignedCityName], [t].[CityOfBirthName], [t].[FullName], [t].[HasSoulPatch], [t].[LeaderNickname], [t].[LeaderSquadId], [t].[Rank], [t].[Discriminator] FROM ( SELECT [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOfBirthName], [g].[FullName], [g].[HasSoulPatch], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[Rank], N'Gear' AS [Discriminator] @@ -13370,7 +13370,7 @@ public override async Task Nav_expansion_inside_Contains_argument(bool async) await base.Nav_expansion_inside_Contains_argument(async); AssertSql( -""" + """ @__numbers_0='[1,-1]' (Size = 4000) SELECT [t].[Nickname], [t].[SquadId], [t].[AssignedCityName], [t].[CityOfBirthName], [t].[FullName], [t].[HasSoulPatch], [t].[LeaderNickname], [t].[LeaderSquadId], [t].[Rank], [t].[Discriminator] @@ -13399,7 +13399,7 @@ public override async Task Nav_expansion_with_member_pushdown_inside_Contains_ar await base.Nav_expansion_with_member_pushdown_inside_Contains_argument(async); AssertSql( -""" + """ @__weapons_0='["Marcus\u0027 Lancer","Dom\u0027s Gnasher"]' (Size = 4000) SELECT [t].[Nickname], [t].[SquadId], [t].[AssignedCityName], [t].[CityOfBirthName], [t].[FullName], [t].[HasSoulPatch], [t].[LeaderNickname], [t].[LeaderSquadId], [t].[Rank], [t].[Discriminator] @@ -13430,7 +13430,7 @@ public override async Task Subquery_inside_Take_argument(bool async) await base.Subquery_inside_Take_argument(async); AssertSql( -""" + """ @__numbers_0='[0,1,2]' (Size = 4000) SELECT [t].[Nickname], [t].[SquadId], [t0].[Id], [t0].[AmmunitionType], [t0].[IsAutomatic], [t0].[Name], [t0].[OwnerFullName], [t0].[SynergyWithId] diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/TPTGearsOfWarQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/TPTGearsOfWarQuerySqlServerTest.cs index bbc6385fe39..625c461e644 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/TPTGearsOfWarQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/TPTGearsOfWarQuerySqlServerTest.cs @@ -2533,15 +2533,15 @@ WHERE [c].[Location] LIKE '%Jacinto%' """); } - public override async Task Non_unicode_string_literals_is_used_for_non_unicode_column_with_concat(bool async) + public override async Task Unicode_string_literals_is_used_for_non_unicode_column_with_concat(bool async) { - await base.Non_unicode_string_literals_is_used_for_non_unicode_column_with_concat(async); + await base.Unicode_string_literals_is_used_for_non_unicode_column_with_concat(async); AssertSql( """ SELECT [c].[Name], [c].[Location], [c].[Nation] FROM [Cities] AS [c] -WHERE COALESCE([c].[Location], '') + 'Added' LIKE '%Add%' +WHERE COALESCE([c].[Location], N'') + N'Added' LIKE N'%Add%' """); } @@ -3562,7 +3562,7 @@ public override async Task Contains_with_local_nullable_guid_list_closure(bool a await base.Contains_with_local_nullable_guid_list_closure(async); AssertSql( -""" + """ @__ids_0='["df36f493-463f-4123-83f9-6b135deeb7ba","23cbcf9b-ce14-45cf-aafa-2c2667ebfdd3","ab1b82d7-88db-42bd-a132-7eef9aa68af4"]' (Size = 4000) SELECT [t].[Id], [t].[GearNickName], [t].[GearSquadId], [t].[IssueDate], [t].[Note] @@ -8495,7 +8495,7 @@ public override async Task FirstOrDefault_navigation_access_entity_equality_in_w await base.FirstOrDefault_navigation_access_entity_equality_in_where_predicate_apply_peneding_selector(async); AssertSql( -""" + """ SELECT [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOfBirthName], [g].[FullName], [g].[HasSoulPatch], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[Rank], CASE WHEN [o].[Nickname] IS NOT NULL THEN N'Officer' END AS [Discriminator] @@ -8769,7 +8769,7 @@ public override async Task Conditional_expression_with_test_being_simplified_to_ await base.Conditional_expression_with_test_being_simplified_to_constant_complex(isAsync); AssertSql( -""" + """ @__prm_0='True' @__prm2_1='Marcus' Lancer' (Size = 4000) @@ -8921,7 +8921,7 @@ public override async Task Checked_context_with_addition_does_not_fail(bool isAs await base.Checked_context_with_addition_does_not_fail(isAsync); AssertSql( -""" + """ SELECT [l].[Name], [l].[LocustHordeId], [l].[ThreatLevel], [l].[ThreatLevelByte], [l].[ThreatLevelNullableByte], [l0].[DefeatedByNickname], [l0].[DefeatedBySquadId], [l0].[HighCommandId], CASE WHEN [l0].[Name] IS NOT NULL THEN N'LocustCommander' END AS [Discriminator] @@ -9479,7 +9479,7 @@ public override async Task FirstOrDefault_over_int_compared_to_zero(bool async) await base.FirstOrDefault_over_int_compared_to_zero(async); AssertSql( -""" + """ SELECT [s].[Name] FROM [Squads] AS [s] WHERE [s].[Name] = N'Delta' AND COALESCE(( @@ -10297,7 +10297,7 @@ public override async Task Parameter_used_multiple_times_take_appropriate_inferr await base.Parameter_used_multiple_times_take_appropriate_inferred_type_mapping(async); AssertSql( -""" + """ @__place_0='Ephyra's location' (Size = 4000), @__place_0_1='Ephyra's location' (Size = 100) (DbType = AnsiString) SELECT [c].[Name], [c].[Location], [c].[Nation] @@ -11196,7 +11196,7 @@ public override async Task Where_subquery_equality_to_null_with_composite_key_sh await base.Where_subquery_equality_to_null_with_composite_key_should_match_nulls(async); AssertSql( -""" + """ SELECT [s].[Id], [s].[Banner], [s].[Banner5], [s].[InternalNumber], [s].[Name] FROM [Squads] AS [s] WHERE NOT EXISTS ( @@ -11230,7 +11230,7 @@ public override async Task Where_subquery_equality_to_null_without_composite_key await base.Where_subquery_equality_to_null_without_composite_key_should_match_null(async); AssertSql( -""" + """ SELECT [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOfBirthName], [g].[FullName], [g].[HasSoulPatch], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[Rank], CASE WHEN [o].[Nickname] IS NOT NULL THEN N'Officer' END AS [Discriminator] @@ -11513,7 +11513,7 @@ public override async Task Nav_expansion_inside_Contains_argument(bool async) await base.Nav_expansion_inside_Contains_argument(async); AssertSql( -""" + """ @__numbers_0='[1,-1]' (Size = 4000) SELECT [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOfBirthName], [g].[FullName], [g].[HasSoulPatch], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[Rank], CASE @@ -11539,7 +11539,7 @@ public override async Task Nav_expansion_with_member_pushdown_inside_Contains_ar await base.Nav_expansion_with_member_pushdown_inside_Contains_argument(async); AssertSql( -""" + """ @__weapons_0='["Marcus\u0027 Lancer","Dom\u0027s Gnasher"]' (Size = 4000) SELECT [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOfBirthName], [g].[FullName], [g].[HasSoulPatch], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[Rank], CASE @@ -11567,7 +11567,7 @@ public override async Task Subquery_inside_Take_argument(bool async) await base.Subquery_inside_Take_argument(async); AssertSql( -""" + """ @__numbers_0='[0,1,2]' (Size = 4000) SELECT [g].[Nickname], [g].[SquadId], [t0].[Id], [t0].[AmmunitionType], [t0].[IsAutomatic], [t0].[Name], [t0].[OwnerFullName], [t0].[SynergyWithId] diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/TemporalComplexNavigationsCollectionsQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/TemporalComplexNavigationsCollectionsQuerySqlServerTest.cs index 7c1c0462aee..6977e6925d6 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/TemporalComplexNavigationsCollectionsQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/TemporalComplexNavigationsCollectionsQuerySqlServerTest.cs @@ -530,7 +530,7 @@ public override async Task Filtered_include_Skip_Take_with_another_Skip_Take_on_ await base.Filtered_include_Skip_Take_with_another_Skip_Take_on_top_level(async); AssertSql( -""" + """ @__p_0='1' @__p_1='5' @@ -3003,7 +3003,7 @@ public override async Task Project_collection_and_nested_conditional(bool async) await base.Project_collection_and_nested_conditional(async); AssertSql( -""" + """ SELECT [l].[Id], [l0].[Name], [l0].[Id], CASE WHEN [l].[Id] = 1 THEN N'01' WHEN [l].[Id] = 2 THEN N'02' diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/TemporalComplexNavigationsCollectionsSharedTypeQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/TemporalComplexNavigationsCollectionsSharedTypeQuerySqlServerTest.cs index afef57de9ec..e2b8f9fe1a2 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/TemporalComplexNavigationsCollectionsSharedTypeQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/TemporalComplexNavigationsCollectionsSharedTypeQuerySqlServerTest.cs @@ -1047,7 +1047,7 @@ public override async Task Filtered_include_Skip_Take_with_another_Skip_Take_on_ await base.Filtered_include_Skip_Take_with_another_Skip_Take_on_top_level(async); AssertSql( -""" + """ @__p_0='1' @__p_1='5' diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/TemporalGearsOfWarQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/TemporalGearsOfWarQuerySqlServerTest.cs index 1d506f99fae..3da8f42fcaf 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/TemporalGearsOfWarQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/TemporalGearsOfWarQuerySqlServerTest.cs @@ -1332,7 +1332,7 @@ public override async Task Conditional_expression_with_test_being_simplified_to_ await base.Conditional_expression_with_test_being_simplified_to_constant_complex(async); AssertSql( -""" + """ @__prm_0='True' @__prm2_1='Marcus' Lancer' (Size = 4000) @@ -2812,7 +2812,7 @@ public override async Task Where_TimeSpan_Seconds(bool async) await base.Where_TimeSpan_Seconds(async); AssertSql( -""" + """ SELECT [m].[Id], [m].[BriefingDocument], [m].[BriefingDocumentFileExtension], [m].[CodeName], [m].[Date], [m].[Duration], [m].[PeriodEnd], [m].[PeriodStart], [m].[Rating], [m].[Time], [m].[Timeline] FROM [Missions] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [m] WHERE DATEPART(second, [m].[Duration]) = 3 @@ -3280,7 +3280,7 @@ public override async Task Parameter_used_multiple_times_take_appropriate_inferr await base.Parameter_used_multiple_times_take_appropriate_inferred_type_mapping(async); AssertSql( -""" + """ @__place_0='Ephyra's location' (Size = 4000), @__place_0_1='Ephyra's location' (Size = 100) (DbType = AnsiString) SELECT [c].[Name], [c].[Location], [c].[Nation], [c].[PeriodEnd], [c].[PeriodStart] @@ -5475,7 +5475,7 @@ public override async Task FirstOrDefault_navigation_access_entity_equality_in_w await base.FirstOrDefault_navigation_access_entity_equality_in_where_predicate_apply_peneding_selector(async); AssertSql( -""" + """ SELECT [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOfBirthName], [g].[Discriminator], [g].[FullName], [g].[HasSoulPatch], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[PeriodEnd], [g].[PeriodStart], [g].[Rank] FROM [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g] LEFT JOIN [Cities] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [c] ON [g].[AssignedCityName] = [c].[Name] @@ -5550,15 +5550,15 @@ INNER JOIN ( """); } - public override async Task Non_unicode_string_literals_is_used_for_non_unicode_column_with_concat(bool async) + public override async Task Unicode_string_literals_is_used_for_non_unicode_column_with_concat(bool async) { - await base.Non_unicode_string_literals_is_used_for_non_unicode_column_with_concat(async); + await base.Unicode_string_literals_is_used_for_non_unicode_column_with_concat(async); AssertSql( """ SELECT [c].[Name], [c].[Location], [c].[Nation], [c].[PeriodEnd], [c].[PeriodStart] FROM [Cities] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [c] -WHERE COALESCE([c].[Location], '') + 'Added' LIKE '%Add%' +WHERE COALESCE([c].[Location], N'') + N'Added' LIKE N'%Add%' """); } @@ -7544,7 +7544,7 @@ public override async Task Checked_context_with_addition_does_not_fail(bool asyn await base.Checked_context_with_addition_does_not_fail(async); AssertSql( -""" + """ SELECT [l].[Name], [l].[Discriminator], [l].[LocustHordeId], [l].[PeriodEnd], [l].[PeriodStart], [l].[ThreatLevel], [l].[ThreatLevelByte], [l].[ThreatLevelNullableByte], [l].[DefeatedByNickname], [l].[DefeatedBySquadId], [l].[HighCommandId] FROM [LocustLeaders] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l] WHERE CAST([l].[ThreatLevel] AS bigint) <= CAST(5 AS bigint) + CAST([l].[ThreatLevel] AS bigint) @@ -8283,7 +8283,7 @@ public override async Task Contains_with_local_nullable_guid_list_closure(bool a await base.Contains_with_local_nullable_guid_list_closure(async); AssertSql( -""" + """ @__ids_0='["df36f493-463f-4123-83f9-6b135deeb7ba","23cbcf9b-ce14-45cf-aafa-2c2667ebfdd3","ab1b82d7-88db-42bd-a132-7eef9aa68af4"]' (Size = 4000) SELECT [t].[Id], [t].[GearNickName], [t].[GearSquadId], [t].[IssueDate], [t].[Note], [t].[PeriodEnd], [t].[PeriodStart] @@ -9433,7 +9433,7 @@ public override async Task FirstOrDefault_over_int_compared_to_zero(bool async) await base.FirstOrDefault_over_int_compared_to_zero(async); AssertSql( -""" + """ SELECT [s].[Name] FROM [Squads] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [s] WHERE [s].[Name] = N'Delta' AND COALESCE(( @@ -9808,7 +9808,7 @@ public override async Task Where_subquery_equality_to_null_with_composite_key_sh await base.Where_subquery_equality_to_null_with_composite_key_should_match_nulls(async); AssertSql( -""" + """ SELECT [s].[Id], [s].[Banner], [s].[Banner5], [s].[InternalNumber], [s].[Name], [s].[PeriodEnd], [s].[PeriodStart] FROM [Squads] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [s] WHERE NOT EXISTS ( @@ -9838,7 +9838,7 @@ public override async Task Where_subquery_equality_to_null_without_composite_key await base.Where_subquery_equality_to_null_without_composite_key_should_match_null(async); AssertSql( -""" + """ SELECT [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOfBirthName], [g].[Discriminator], [g].[FullName], [g].[HasSoulPatch], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[PeriodEnd], [g].[PeriodStart], [g].[Rank] FROM [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g] WHERE NOT EXISTS ( @@ -10050,7 +10050,7 @@ public override async Task Nav_expansion_inside_Contains_argument(bool async) await base.Nav_expansion_inside_Contains_argument(async); AssertSql( -""" + """ @__numbers_0='[1,-1]' (Size = 4000) SELECT [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOfBirthName], [g].[Discriminator], [g].[FullName], [g].[HasSoulPatch], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[PeriodEnd], [g].[PeriodStart], [g].[Rank] @@ -10073,7 +10073,7 @@ public override async Task Nav_expansion_with_member_pushdown_inside_Contains_ar await base.Nav_expansion_with_member_pushdown_inside_Contains_argument(async); AssertSql( -""" + """ @__weapons_0='["Marcus\u0027 Lancer","Dom\u0027s Gnasher"]' (Size = 4000) SELECT [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOfBirthName], [g].[Discriminator], [g].[FullName], [g].[HasSoulPatch], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[PeriodEnd], [g].[PeriodStart], [g].[Rank] @@ -10098,7 +10098,7 @@ public override async Task Subquery_inside_Take_argument(bool async) await base.Subquery_inside_Take_argument(async); AssertSql( -""" + """ @__numbers_0='[0,1,2]' (Size = 4000) SELECT [g].[Nickname], [g].[SquadId], [t0].[Id], [t0].[AmmunitionType], [t0].[IsAutomatic], [t0].[Name], [t0].[OwnerFullName], [t0].[PeriodEnd], [t0].[PeriodStart], [t0].[SynergyWithId] diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/TemporalOwnedQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/TemporalOwnedQuerySqlServerTest.cs index 7e272a1c05c..b8db03bd507 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/TemporalOwnedQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/TemporalOwnedQuerySqlServerTest.cs @@ -69,7 +69,7 @@ public virtual async Task Navigation_on_owned_entity_mapped_to_same_table_works_ : queryBetween.ToList(); AssertSql( -""" + """ SELECT [o].[Id], [o].[Discriminator], [o].[Name], [o].[PeriodEnd], [o].[PeriodStart], [t].[ClientId], [t].[Id], [t].[OrderDate], [t].[PeriodEnd], [t].[PeriodStart], [t].[OrderClientId], [t].[OrderId], [t].[Id0], [t].[Detail], [t].[PeriodEnd0], [t].[PeriodStart0], [o].[PersonAddress_AddressLine], [o].[PeriodEnd], [o].[PeriodStart], [o].[PersonAddress_PlaceType], [o].[PersonAddress_ZipCode], [o].[PersonAddress_Country_Name], [o].[PersonAddress_Country_PlanetId], [o].[BranchAddress_BranchName], [o].[BranchAddress_PlaceType], [o].[BranchAddress_Country_Name], [o].[BranchAddress_Country_PlanetId], [o].[LeafBAddress_LeafBType], [o].[LeafBAddress_PlaceType], [o].[LeafBAddress_Country_Name], [o].[LeafBAddress_Country_PlanetId], [o].[LeafAAddress_LeafType], [o].[LeafAAddress_PlaceType], [o].[LeafAAddress_Country_Name], [o].[LeafAAddress_Country_PlanetId] FROM [OwnedPerson] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [o] LEFT JOIN ( diff --git a/test/EFCore.SqlServer.FunctionalTests/Update/JsonUpdateSqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Update/JsonUpdateSqlServerTest.cs index 3054f0bbe3a..09e841fac2f 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Update/JsonUpdateSqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Update/JsonUpdateSqlServerTest.cs @@ -127,7 +127,7 @@ public override async Task Add_entity_with_json() await base.Add_entity_with_json(); AssertSql( -""" + """ @p0='{"Name":"RootName","Names":null,"Number":42,"Numbers":null,"OwnedCollectionBranch":[],"OwnedReferenceBranch":{"Date":"2010-10-10T00:00:00","Enum":2,"Enums":null,"Fraction":42.42,"NullableEnum":null,"NullableEnums":null,"OwnedCollectionLeaf":[{"SomethingSomething":"ss1"},{"SomethingSomething":"ss2"}],"OwnedReferenceLeaf":{"SomethingSomething":"ss3"}}}' (Nullable = false) (Size = 352) @p1='[]' (Nullable = false) (Size = 2) @p2='2' @@ -151,7 +151,7 @@ public override async Task Add_entity_with_json_null_navigations() await base.Add_entity_with_json_null_navigations(); AssertSql( -""" + """ @p0='{"Name":"RootName","Names":null,"Number":42,"Numbers":null,"OwnedCollectionBranch":null,"OwnedReferenceBranch":{"Date":"2010-10-10T00:00:00","Enum":2,"Enums":null,"Fraction":42.42,"NullableEnum":null,"NullableEnums":null,"OwnedCollectionLeaf":[{"SomethingSomething":"ss1"},{"SomethingSomething":"ss2"}],"OwnedReferenceLeaf":null}}' (Nullable = false) (Size = 330) @p1='2' @p2=NULL (DbType = Int32) @@ -2462,7 +2462,7 @@ FROM [JsonEntitiesAllTypes] AS [j] WHERE [j].[Id] = 7624 """, // - + "@p0=" + updateParameter + @" (Nullable = false) (Size = 4000) @p1='7624' diff --git a/test/EFCore.Sqlite.FunctionalTests/Migrations/MigrationsSqliteTest.cs b/test/EFCore.Sqlite.FunctionalTests/Migrations/MigrationsSqliteTest.cs index 35c6bb91215..515f0cd8e72 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Migrations/MigrationsSqliteTest.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Migrations/MigrationsSqliteTest.cs @@ -1105,7 +1105,7 @@ public override async Task Convert_json_entities_to_regular_owned() await base.Convert_json_entities_to_regular_owned(); AssertSql( -""" + """ ALTER TABLE "Entity" RENAME COLUMN "OwnedReference" TO "OwnedReference_Date"; """, // diff --git a/test/EFCore.Sqlite.FunctionalTests/Query/ComplexTypeQuerySqliteTest.cs b/test/EFCore.Sqlite.FunctionalTests/Query/ComplexTypeQuerySqliteTest.cs index d3423b9e7d0..51c426cd289 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Query/ComplexTypeQuerySqliteTest.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Query/ComplexTypeQuerySqliteTest.cs @@ -385,7 +385,7 @@ public override async Task Filter_on_property_inside_struct_complex_type(bool as await base.Filter_on_property_inside_struct_complex_type(async); AssertSql( -""" + """ SELECT "v"."Id", "v"."Name", "v"."BillingAddress_AddressLine1", "v"."BillingAddress_AddressLine2", "v"."BillingAddress_ZipCode", "v"."BillingAddress_Country_Code", "v"."BillingAddress_Country_FullName", "v"."ShippingAddress_AddressLine1", "v"."ShippingAddress_AddressLine2", "v"."ShippingAddress_ZipCode", "v"."ShippingAddress_Country_Code", "v"."ShippingAddress_Country_FullName" FROM "ValuedCustomer" AS "v" WHERE "v"."ShippingAddress_ZipCode" = 7728 @@ -397,7 +397,7 @@ public override async Task Filter_on_property_inside_nested_struct_complex_type( await base.Filter_on_property_inside_nested_struct_complex_type(async); AssertSql( -""" + """ SELECT "v"."Id", "v"."Name", "v"."BillingAddress_AddressLine1", "v"."BillingAddress_AddressLine2", "v"."BillingAddress_ZipCode", "v"."BillingAddress_Country_Code", "v"."BillingAddress_Country_FullName", "v"."ShippingAddress_AddressLine1", "v"."ShippingAddress_AddressLine2", "v"."ShippingAddress_ZipCode", "v"."ShippingAddress_Country_Code", "v"."ShippingAddress_Country_FullName" FROM "ValuedCustomer" AS "v" WHERE "v"."ShippingAddress_Country_Code" = 'DE' @@ -409,7 +409,7 @@ public override async Task Filter_on_property_inside_struct_complex_type_after_s await base.Filter_on_property_inside_struct_complex_type_after_subquery(async); AssertSql( -""" + """ @__p_0='1' SELECT DISTINCT "t"."Id", "t"."Name", "t"."BillingAddress_AddressLine1", "t"."BillingAddress_AddressLine2", "t"."BillingAddress_ZipCode", "t"."BillingAddress_Country_Code", "t"."BillingAddress_Country_FullName", "t"."ShippingAddress_AddressLine1", "t"."ShippingAddress_AddressLine2", "t"."ShippingAddress_ZipCode", "t"."ShippingAddress_Country_Code", "t"."ShippingAddress_Country_FullName" @@ -428,7 +428,7 @@ public override async Task Filter_on_property_inside_nested_struct_complex_type_ await base.Filter_on_property_inside_nested_struct_complex_type_after_subquery(async); AssertSql( -""" + """ @__p_0='1' SELECT DISTINCT "t"."Id", "t"."Name", "t"."BillingAddress_AddressLine1", "t"."BillingAddress_AddressLine2", "t"."BillingAddress_ZipCode", "t"."BillingAddress_Country_Code", "t"."BillingAddress_Country_FullName", "t"."ShippingAddress_AddressLine1", "t"."ShippingAddress_AddressLine2", "t"."ShippingAddress_ZipCode", "t"."ShippingAddress_Country_Code", "t"."ShippingAddress_Country_FullName" @@ -447,7 +447,7 @@ public override async Task Filter_on_required_property_inside_required_struct_co await base.Filter_on_required_property_inside_required_struct_complex_type_on_optional_navigation(async); AssertSql( -""" + """ SELECT "v"."Id", "v"."OptionalCustomerId", "v"."RequiredCustomerId", "v0"."Id", "v0"."Name", "v0"."BillingAddress_AddressLine1", "v0"."BillingAddress_AddressLine2", "v0"."BillingAddress_ZipCode", "v0"."BillingAddress_Country_Code", "v0"."BillingAddress_Country_FullName", "v0"."ShippingAddress_AddressLine1", "v0"."ShippingAddress_AddressLine2", "v0"."ShippingAddress_ZipCode", "v0"."ShippingAddress_Country_Code", "v0"."ShippingAddress_Country_FullName", "v1"."Id", "v1"."Name", "v1"."BillingAddress_AddressLine1", "v1"."BillingAddress_AddressLine2", "v1"."BillingAddress_ZipCode", "v1"."BillingAddress_Country_Code", "v1"."BillingAddress_Country_FullName", "v1"."ShippingAddress_AddressLine1", "v1"."ShippingAddress_AddressLine2", "v1"."ShippingAddress_ZipCode", "v1"."ShippingAddress_Country_Code", "v1"."ShippingAddress_Country_FullName" FROM "ValuedCustomerGroup" AS "v" LEFT JOIN "ValuedCustomer" AS "v0" ON "v"."OptionalCustomerId" = "v0"."Id" @@ -461,7 +461,7 @@ public override async Task Filter_on_required_property_inside_required_struct_co await base.Filter_on_required_property_inside_required_struct_complex_type_on_required_navigation(async); AssertSql( -""" + """ SELECT "v"."Id", "v"."OptionalCustomerId", "v"."RequiredCustomerId", "v1"."Id", "v1"."Name", "v1"."BillingAddress_AddressLine1", "v1"."BillingAddress_AddressLine2", "v1"."BillingAddress_ZipCode", "v1"."BillingAddress_Country_Code", "v1"."BillingAddress_Country_FullName", "v1"."ShippingAddress_AddressLine1", "v1"."ShippingAddress_AddressLine2", "v1"."ShippingAddress_ZipCode", "v1"."ShippingAddress_Country_Code", "v1"."ShippingAddress_Country_FullName", "v0"."Id", "v0"."Name", "v0"."BillingAddress_AddressLine1", "v0"."BillingAddress_AddressLine2", "v0"."BillingAddress_ZipCode", "v0"."BillingAddress_Country_Code", "v0"."BillingAddress_Country_FullName", "v0"."ShippingAddress_AddressLine1", "v0"."ShippingAddress_AddressLine2", "v0"."ShippingAddress_ZipCode", "v0"."ShippingAddress_Country_Code", "v0"."ShippingAddress_Country_FullName" FROM "ValuedCustomerGroup" AS "v" INNER JOIN "ValuedCustomer" AS "v0" ON "v"."RequiredCustomerId" = "v0"."Id" @@ -485,7 +485,7 @@ public override async Task Project_struct_complex_type_via_required_navigation(b await base.Project_struct_complex_type_via_required_navigation(async); AssertSql( -""" + """ SELECT "v0"."ShippingAddress_AddressLine1", "v0"."ShippingAddress_AddressLine2", "v0"."ShippingAddress_ZipCode", "v0"."ShippingAddress_Country_Code", "v0"."ShippingAddress_Country_FullName" FROM "ValuedCustomerGroup" AS "v" INNER JOIN "ValuedCustomer" AS "v0" ON "v"."RequiredCustomerId" = "v0"."Id" @@ -497,7 +497,7 @@ public override async Task Load_struct_complex_type_after_subquery_on_entity_typ await base.Load_struct_complex_type_after_subquery_on_entity_type(async); AssertSql( -""" + """ @__p_0='1' SELECT DISTINCT "t"."Id", "t"."Name", "t"."BillingAddress_AddressLine1", "t"."BillingAddress_AddressLine2", "t"."BillingAddress_ZipCode", "t"."BillingAddress_Country_Code", "t"."BillingAddress_Country_FullName", "t"."ShippingAddress_AddressLine1", "t"."ShippingAddress_AddressLine2", "t"."ShippingAddress_ZipCode", "t"."ShippingAddress_Country_Code", "t"."ShippingAddress_Country_FullName" @@ -515,7 +515,7 @@ public override async Task Select_struct_complex_type(bool async) await base.Select_struct_complex_type(async); AssertSql( -""" + """ SELECT "v"."ShippingAddress_AddressLine1", "v"."ShippingAddress_AddressLine2", "v"."ShippingAddress_ZipCode", "v"."ShippingAddress_Country_Code", "v"."ShippingAddress_Country_FullName" FROM "ValuedCustomer" AS "v" """); @@ -526,7 +526,7 @@ public override async Task Select_nested_struct_complex_type(bool async) await base.Select_nested_struct_complex_type(async); AssertSql( -""" + """ SELECT "v"."ShippingAddress_Country_Code", "v"."ShippingAddress_Country_FullName" FROM "ValuedCustomer" AS "v" """); @@ -537,7 +537,7 @@ public override async Task Select_single_property_on_nested_struct_complex_type( await base.Select_single_property_on_nested_struct_complex_type(async); AssertSql( -""" + """ SELECT "v"."ShippingAddress_Country_FullName" FROM "ValuedCustomer" AS "v" """); @@ -548,7 +548,7 @@ public override async Task Select_struct_complex_type_Where(bool async) await base.Select_struct_complex_type_Where(async); AssertSql( -""" + """ SELECT "v"."ShippingAddress_AddressLine1", "v"."ShippingAddress_AddressLine2", "v"."ShippingAddress_ZipCode", "v"."ShippingAddress_Country_Code", "v"."ShippingAddress_Country_FullName" FROM "ValuedCustomer" AS "v" WHERE "v"."ShippingAddress_ZipCode" = 7728 @@ -560,7 +560,7 @@ public override async Task Select_struct_complex_type_Distinct(bool async) await base.Select_struct_complex_type_Distinct(async); AssertSql( -""" + """ SELECT DISTINCT "v"."ShippingAddress_AddressLine1", "v"."ShippingAddress_AddressLine2", "v"."ShippingAddress_ZipCode", "v"."ShippingAddress_Country_Code", "v"."ShippingAddress_Country_FullName" FROM "ValuedCustomer" AS "v" """); @@ -571,7 +571,7 @@ public override async Task Struct_complex_type_equals_struct_complex_type(bool a await base.Struct_complex_type_equals_struct_complex_type(async); AssertSql( -""" + """ SELECT "v"."Id", "v"."Name", "v"."BillingAddress_AddressLine1", "v"."BillingAddress_AddressLine2", "v"."BillingAddress_ZipCode", "v"."BillingAddress_Country_Code", "v"."BillingAddress_Country_FullName", "v"."ShippingAddress_AddressLine1", "v"."ShippingAddress_AddressLine2", "v"."ShippingAddress_ZipCode", "v"."ShippingAddress_Country_Code", "v"."ShippingAddress_Country_FullName" FROM "ValuedCustomer" AS "v" WHERE "v"."ShippingAddress_AddressLine1" = "v"."BillingAddress_AddressLine1" AND ("v"."ShippingAddress_AddressLine2" = "v"."BillingAddress_AddressLine2" OR ("v"."ShippingAddress_AddressLine2" IS NULL AND "v"."BillingAddress_AddressLine2" IS NULL)) AND "v"."ShippingAddress_ZipCode" = "v"."BillingAddress_ZipCode" @@ -583,7 +583,7 @@ public override async Task Struct_complex_type_equals_constant(bool async) await base.Struct_complex_type_equals_constant(async); AssertSql( -""" + """ SELECT "v"."Id", "v"."Name", "v"."BillingAddress_AddressLine1", "v"."BillingAddress_AddressLine2", "v"."BillingAddress_ZipCode", "v"."BillingAddress_Country_Code", "v"."BillingAddress_Country_FullName", "v"."ShippingAddress_AddressLine1", "v"."ShippingAddress_AddressLine2", "v"."ShippingAddress_ZipCode", "v"."ShippingAddress_Country_Code", "v"."ShippingAddress_Country_FullName" FROM "ValuedCustomer" AS "v" WHERE "v"."ShippingAddress_AddressLine1" = '804 S. Lakeshore Road' AND "v"."ShippingAddress_AddressLine2" IS NULL AND "v"."ShippingAddress_ZipCode" = 38654 AND "v"."ShippingAddress_Country_Code" = 'US' AND "v"."ShippingAddress_Country_FullName" = 'United States' @@ -595,7 +595,7 @@ public override async Task Struct_complex_type_equals_parameter(bool async) await base.Struct_complex_type_equals_parameter(async); AssertSql( -""" + """ @__entity_equality_address_0_AddressLine1='804 S. Lakeshore Road' (Size = 21) @__entity_equality_address_0_ZipCode='38654' (Nullable = true) @__entity_equality_address_0_Code='US' (Size = 2) @@ -619,7 +619,7 @@ public override async Task Contains_over_struct_complex_type(bool async) await base.Contains_over_struct_complex_type(async); AssertSql( -""" + """ @__entity_equality_address_0_AddressLine1='804 S. Lakeshore Road' (Size = 21) @__entity_equality_address_0_ZipCode='38654' (Nullable = true) @__entity_equality_address_0_Code='US' (Size = 2) @@ -639,7 +639,7 @@ public override async Task Concat_struct_complex_type(bool async) await base.Concat_struct_complex_type(async); AssertSql( -""" + """ SELECT "v"."ShippingAddress_AddressLine1", "v"."ShippingAddress_AddressLine2", "v"."ShippingAddress_ZipCode", "v"."ShippingAddress_Country_Code", "v"."ShippingAddress_Country_FullName" FROM "ValuedCustomer" AS "v" WHERE "v"."Id" = 1 @@ -655,7 +655,7 @@ public override async Task Concat_entity_type_containing_struct_complex_property await base.Concat_entity_type_containing_struct_complex_property(async); AssertSql( -""" + """ SELECT "v"."Id", "v"."Name", "v"."BillingAddress_AddressLine1", "v"."BillingAddress_AddressLine2", "v"."BillingAddress_ZipCode", "v"."BillingAddress_Country_Code", "v"."BillingAddress_Country_FullName", "v"."ShippingAddress_AddressLine1", "v"."ShippingAddress_AddressLine2", "v"."ShippingAddress_ZipCode", "v"."ShippingAddress_Country_Code", "v"."ShippingAddress_Country_FullName" FROM "ValuedCustomer" AS "v" WHERE "v"."Id" = 1 @@ -671,7 +671,7 @@ public override async Task Union_entity_type_containing_struct_complex_property( await base.Union_entity_type_containing_struct_complex_property(async); AssertSql( -""" + """ SELECT "v"."Id", "v"."Name", "v"."BillingAddress_AddressLine1", "v"."BillingAddress_AddressLine2", "v"."BillingAddress_ZipCode", "v"."BillingAddress_Country_Code", "v"."BillingAddress_Country_FullName", "v"."ShippingAddress_AddressLine1", "v"."ShippingAddress_AddressLine2", "v"."ShippingAddress_ZipCode", "v"."ShippingAddress_Country_Code", "v"."ShippingAddress_Country_FullName" FROM "ValuedCustomer" AS "v" WHERE "v"."Id" = 1 @@ -687,7 +687,7 @@ public override async Task Union_struct_complex_type(bool async) await base.Union_struct_complex_type(async); AssertSql( -""" + """ SELECT "v"."ShippingAddress_AddressLine1", "v"."ShippingAddress_AddressLine2", "v"."ShippingAddress_ZipCode", "v"."ShippingAddress_Country_Code", "v"."ShippingAddress_Country_FullName" FROM "ValuedCustomer" AS "v" WHERE "v"."Id" = 1 @@ -703,7 +703,7 @@ public override async Task Concat_property_in_struct_complex_type(bool async) await base.Concat_property_in_struct_complex_type(async); AssertSql( -""" + """ SELECT "v"."ShippingAddress_AddressLine1" FROM "ValuedCustomer" AS "v" UNION ALL @@ -717,7 +717,7 @@ public override async Task Union_property_in_struct_complex_type(bool async) await base.Union_property_in_struct_complex_type(async); AssertSql( -""" + """ SELECT "v"."ShippingAddress_AddressLine1" FROM "ValuedCustomer" AS "v" UNION diff --git a/test/EFCore.Sqlite.FunctionalTests/Query/GearsOfWarQuerySqliteTest.cs b/test/EFCore.Sqlite.FunctionalTests/Query/GearsOfWarQuerySqliteTest.cs index 1315218c721..e23c7751d1a 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Query/GearsOfWarQuerySqliteTest.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Query/GearsOfWarQuerySqliteTest.cs @@ -388,7 +388,7 @@ public override async Task Byte_array_filter_by_length_literal(bool async) await base.Byte_array_filter_by_length_literal(async); AssertSql( -""" + """ SELECT "s"."Id", "s"."Banner", "s"."Banner5", "s"."InternalNumber", "s"."Name" FROM "Squads" AS "s" WHERE length("s"."Banner") = 2 @@ -400,7 +400,7 @@ public override async Task Byte_array_filter_by_length_parameter(bool async) await base.Byte_array_filter_by_length_parameter(async); AssertSql( -""" + """ @__p_0='2' SELECT "s"."Id", "s"."Banner", "s"."Banner5", "s"."InternalNumber", "s"."Name" @@ -2885,7 +2885,7 @@ public override async Task Parameter_used_multiple_times_take_appropriate_inferr await base.Parameter_used_multiple_times_take_appropriate_inferred_type_mapping(async); AssertSql( -""" + """ @__place_0='Ephyra's location' (Size = 17) SELECT "c"."Name", "c"."Location", "c"."Nation" @@ -4124,7 +4124,7 @@ public override async Task FirstOrDefault_navigation_access_entity_equality_in_w await base.FirstOrDefault_navigation_access_entity_equality_in_where_predicate_apply_peneding_selector(async); AssertSql( -""" + """ 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" LEFT JOIN "Cities" AS "c" ON "g"."AssignedCityName" = "c"."Name" @@ -6379,9 +6379,9 @@ LEFT JOIN ( """); } - public override async Task Non_unicode_string_literals_is_used_for_non_unicode_column_with_concat(bool async) + public override async Task Unicode_string_literals_is_used_for_non_unicode_column_with_concat(bool async) { - await base.Non_unicode_string_literals_is_used_for_non_unicode_column_with_concat(async); + await base.Unicode_string_literals_is_used_for_non_unicode_column_with_concat(async); AssertSql( """ @@ -6617,7 +6617,7 @@ public override async Task Conditional_expression_with_test_being_simplified_to_ await base.Conditional_expression_with_test_being_simplified_to_constant_complex(async); AssertSql( -""" + """ @__prm_0='True' @__prm2_1='Marcus' Lancer' (Size = 14) @@ -7556,7 +7556,7 @@ public override async Task FirstOrDefault_over_int_compared_to_zero(bool async) await base.FirstOrDefault_over_int_compared_to_zero(async); AssertSql( -""" + """ SELECT "s"."Name" FROM "Squads" AS "s" WHERE "s"."Name" = 'Delta' AND COALESCE(( @@ -7972,7 +7972,7 @@ public override async Task Contains_with_local_nullable_guid_list_closure(bool a await base.Contains_with_local_nullable_guid_list_closure(async); AssertSql( -""" + """ @__ids_0='["DF36F493-463F-4123-83F9-6B135DEEB7BA","23CBCF9B-CE14-45CF-AAFA-2C2667EBFDD3","AB1B82D7-88DB-42BD-A132-7EEF9AA68AF4"]' (Size = 118) SELECT "t"."Id", "t"."GearNickName", "t"."GearSquadId", "t"."IssueDate", "t"."Note" @@ -8289,7 +8289,7 @@ public override async Task Checked_context_with_addition_does_not_fail(bool asyn await base.Checked_context_with_addition_does_not_fail(async); AssertSql( -""" + """ SELECT "l"."Name", "l"."Discriminator", "l"."LocustHordeId", "l"."ThreatLevel", "l"."ThreatLevelByte", "l"."ThreatLevelNullableByte", "l"."DefeatedByNickname", "l"."DefeatedBySquadId", "l"."HighCommandId" FROM "LocustLeaders" AS "l" WHERE CAST("l"."ThreatLevel" AS INTEGER) <= 5 + CAST("l"."ThreatLevel" AS INTEGER) @@ -9311,7 +9311,7 @@ public override async Task Where_subquery_equality_to_null_with_composite_key_sh await base.Where_subquery_equality_to_null_with_composite_key_should_match_nulls(async); AssertSql( -""" + """ SELECT "s"."Id", "s"."Banner", "s"."Banner5", "s"."InternalNumber", "s"."Name" FROM "Squads" AS "s" WHERE NOT EXISTS ( @@ -9341,7 +9341,7 @@ public override async Task Where_subquery_equality_to_null_without_composite_key await base.Where_subquery_equality_to_null_without_composite_key_should_match_null(async); AssertSql( -""" + """ 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 NOT EXISTS ( @@ -9525,7 +9525,7 @@ public override async Task Nav_expansion_inside_Contains_argument(bool async) await base.Nav_expansion_inside_Contains_argument(async); AssertSql( -""" + """ @__numbers_0='[1,-1]' (Size = 6) SELECT "g"."Nickname", "g"."SquadId", "g"."AssignedCityName", "g"."CityOfBirthName", "g"."Discriminator", "g"."FullName", "g"."HasSoulPatch", "g"."LeaderNickname", "g"."LeaderSquadId", "g"."Rank" @@ -9548,7 +9548,7 @@ public override async Task Nav_expansion_with_member_pushdown_inside_Contains_ar await base.Nav_expansion_with_member_pushdown_inside_Contains_argument(async); AssertSql( -""" + """ @__weapons_0='["Marcus\u0027 Lancer","Dom\u0027s Gnasher"]' (Size = 44) SELECT "g"."Nickname", "g"."SquadId", "g"."AssignedCityName", "g"."CityOfBirthName", "g"."Discriminator", "g"."FullName", "g"."HasSoulPatch", "g"."LeaderNickname", "g"."LeaderSquadId", "g"."Rank" @@ -9575,7 +9575,7 @@ public override async Task Subquery_inside_Take_argument(bool async) await base.Subquery_inside_Take_argument(async); AssertSql( -""" + """ @__numbers_0='[0,1,2]' (Size = 7) SELECT "g"."Nickname", "g"."SquadId", "t0"."Id", "t0"."AmmunitionType", "t0"."IsAutomatic", "t0"."Name", "t0"."OwnerFullName", "t0"."SynergyWithId" diff --git a/test/EFCore.Sqlite.FunctionalTests/Query/JsonQuerySqliteTest.cs b/test/EFCore.Sqlite.FunctionalTests/Query/JsonQuerySqliteTest.cs index f0aaf7c5f94..d0bcd5a9a26 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Query/JsonQuerySqliteTest.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Query/JsonQuerySqliteTest.cs @@ -72,7 +72,7 @@ public override async Task Json_collection_Any_with_predicate(bool async) await base.Json_collection_Any_with_predicate(async); AssertSql( -""" + """ SELECT "j"."Id", "j"."EntityBasicId", "j"."Name", "j"."OwnedCollectionRoot", "j"."OwnedReferenceRoot" FROM "JsonEntitiesBasic" AS "j" WHERE EXISTS ( diff --git a/test/EFCore.Sqlite.FunctionalTests/Query/NorthwindMiscellaneousQuerySqliteTest.cs b/test/EFCore.Sqlite.FunctionalTests/Query/NorthwindMiscellaneousQuerySqliteTest.cs index cdc9874bcfb..c0cf5800c75 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Query/NorthwindMiscellaneousQuerySqliteTest.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Query/NorthwindMiscellaneousQuerySqliteTest.cs @@ -23,7 +23,7 @@ public override async Task Query_expression_with_to_string_and_contains(bool asy await base.Query_expression_with_to_string_and_contains(async); AssertSql( -""" + """ SELECT "o"."CustomerID" FROM "Orders" AS "o" WHERE "o"."OrderDate" IS NOT NULL AND "o"."EmployeeID" IS NOT NULL AND instr(CAST("o"."EmployeeID" AS TEXT), '7') > 0 diff --git a/test/EFCore.Sqlite.FunctionalTests/Query/NorthwindWhereQuerySqliteTest.cs b/test/EFCore.Sqlite.FunctionalTests/Query/NorthwindWhereQuerySqliteTest.cs index a926ac22ff0..0964acbe643 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Query/NorthwindWhereQuerySqliteTest.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Query/NorthwindWhereQuerySqliteTest.cs @@ -151,7 +151,7 @@ public override async Task Where_datetime_hour_component(bool async) await base.Where_datetime_hour_component(async); AssertSql( -""" + """ SELECT "o"."OrderID", "o"."CustomerID", "o"."EmployeeID", "o"."OrderDate" FROM "Orders" AS "o" WHERE CAST(strftime('%H', "o"."OrderDate") AS INTEGER) = 0 @@ -163,7 +163,7 @@ public override async Task Where_datetime_minute_component(bool async) await base.Where_datetime_minute_component(async); AssertSql( -""" + """ SELECT "o"."OrderID", "o"."CustomerID", "o"."EmployeeID", "o"."OrderDate" FROM "Orders" AS "o" WHERE CAST(strftime('%M', "o"."OrderDate") AS INTEGER) = 0 @@ -175,7 +175,7 @@ public override async Task Where_datetime_second_component(bool async) await base.Where_datetime_second_component(async); AssertSql( -""" + """ SELECT "o"."OrderID", "o"."CustomerID", "o"."EmployeeID", "o"."OrderDate" FROM "Orders" AS "o" WHERE CAST(strftime('%S', "o"."OrderDate") AS INTEGER) = 0 @@ -187,7 +187,7 @@ public override async Task Where_datetime_millisecond_component(bool async) await base.Where_datetime_millisecond_component(async); AssertSql( -""" + """ SELECT "o"."OrderID", "o"."CustomerID", "o"."EmployeeID", "o"."OrderDate" FROM "Orders" AS "o" WHERE (CAST(strftime('%f', "o"."OrderDate") AS REAL) * 1000.0) % 1000.0 = 0.0 diff --git a/test/EFCore.Sqlite.FunctionalTests/Query/NullSemanticsQuerySqliteTest.cs b/test/EFCore.Sqlite.FunctionalTests/Query/NullSemanticsQuerySqliteTest.cs index 16853163e9a..a2b157c9002 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Query/NullSemanticsQuerySqliteTest.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Query/NullSemanticsQuerySqliteTest.cs @@ -92,7 +92,7 @@ public override async Task Null_semantics_contains_nullable_item_with_nullable_s await base.Null_semantics_contains_nullable_item_with_nullable_subquery(async); AssertSql( -""" + """ SELECT "e"."Id" FROM "Entities1" AS "e" WHERE EXISTS ( diff --git a/test/EFCore.Sqlite.FunctionalTests/Query/OptionalDependentQuerySqliteTest.cs b/test/EFCore.Sqlite.FunctionalTests/Query/OptionalDependentQuerySqliteTest.cs index 901c94b5c93..fd139ec1d53 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Query/OptionalDependentQuerySqliteTest.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Query/OptionalDependentQuerySqliteTest.cs @@ -17,7 +17,7 @@ public override async Task Basic_projection_entity_with_all_optional(bool async) await base.Basic_projection_entity_with_all_optional(async); AssertSql( -""" + """ SELECT "e"."Id", "e"."Name", "e"."Json" FROM "EntitiesAllOptional" AS "e" """); @@ -28,7 +28,7 @@ public override async Task Basic_projection_entity_with_some_required(bool async await base.Basic_projection_entity_with_some_required(async); AssertSql( -""" + """ SELECT "e"."Id", "e"."Name", "e"."Json" FROM "EntitiesSomeRequired" AS "e" """); @@ -39,7 +39,7 @@ public override async Task Filter_optional_dependent_with_all_optional_compared_ await base.Filter_optional_dependent_with_all_optional_compared_to_null(async); AssertSql( -""" + """ SELECT "e"."Id", "e"."Name", "e"."Json" FROM "EntitiesAllOptional" AS "e" WHERE "e"."Json" IS NULL @@ -51,7 +51,7 @@ public override async Task Filter_optional_dependent_with_all_optional_compared_ await base.Filter_optional_dependent_with_all_optional_compared_to_not_null(async); AssertSql( -""" + """ SELECT "e"."Id", "e"."Name", "e"."Json" FROM "EntitiesAllOptional" AS "e" WHERE "e"."Json" IS NOT NULL @@ -63,7 +63,7 @@ public override async Task Filter_optional_dependent_with_some_required_compared await base.Filter_optional_dependent_with_some_required_compared_to_null(async); AssertSql( -""" + """ SELECT "e"."Id", "e"."Name", "e"."Json" FROM "EntitiesSomeRequired" AS "e" WHERE "e"."Json" IS NULL @@ -75,7 +75,7 @@ public override async Task Filter_optional_dependent_with_some_required_compared await base.Filter_optional_dependent_with_some_required_compared_to_not_null(async); AssertSql( -""" + """ SELECT "e"."Id", "e"."Name", "e"."Json" FROM "EntitiesSomeRequired" AS "e" WHERE "e"."Json" IS NOT NULL @@ -87,7 +87,7 @@ public override async Task Filter_nested_optional_dependent_with_all_optional_co await base.Filter_nested_optional_dependent_with_all_optional_compared_to_null(async); AssertSql( -""" + """ SELECT "e"."Id", "e"."Name", "e"."Json" FROM "EntitiesAllOptional" AS "e" WHERE "e"."Json" ->> 'OpNav1' IS NULL @@ -99,7 +99,7 @@ public override async Task Filter_nested_optional_dependent_with_all_optional_co await base.Filter_nested_optional_dependent_with_all_optional_compared_to_not_null(async); AssertSql( -""" + """ SELECT "e"."Id", "e"."Name", "e"."Json" FROM "EntitiesAllOptional" AS "e" WHERE "e"."Json" ->> 'OpNav2' IS NOT NULL @@ -111,7 +111,7 @@ public override async Task Filter_nested_optional_dependent_with_some_required_c await base.Filter_nested_optional_dependent_with_some_required_compared_to_null(async); AssertSql( -""" + """ SELECT "e"."Id", "e"."Name", "e"."Json" FROM "EntitiesSomeRequired" AS "e" WHERE "e"."Json" ->> 'ReqNav1' IS NULL @@ -123,7 +123,7 @@ public override async Task Filter_nested_optional_dependent_with_some_required_c await base.Filter_nested_optional_dependent_with_some_required_compared_to_not_null(async); AssertSql( -""" + """ SELECT "e"."Id", "e"."Name", "e"."Json" FROM "EntitiesSomeRequired" AS "e" WHERE "e"."Json" ->> 'ReqNav2' IS NOT NULL diff --git a/test/EFCore.Sqlite.FunctionalTests/Query/TPCGearsOfWarQuerySqliteTest.cs b/test/EFCore.Sqlite.FunctionalTests/Query/TPCGearsOfWarQuerySqliteTest.cs index bc37bec914b..c0f4976a051 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Query/TPCGearsOfWarQuerySqliteTest.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Query/TPCGearsOfWarQuerySqliteTest.cs @@ -262,7 +262,7 @@ public override async Task Byte_array_filter_by_length_parameter(bool async) await base.Byte_array_filter_by_length_parameter(async); AssertSql( -""" + """ @__p_0='2' SELECT "s"."Id", "s"."Banner", "s"."Banner5", "s"."InternalNumber", "s"."Name" diff --git a/test/EFCore.Sqlite.FunctionalTests/Query/TPTGearsOfWarQuerySqliteTest.cs b/test/EFCore.Sqlite.FunctionalTests/Query/TPTGearsOfWarQuerySqliteTest.cs index c4c62500c58..fd99c211826 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Query/TPTGearsOfWarQuerySqliteTest.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Query/TPTGearsOfWarQuerySqliteTest.cs @@ -250,7 +250,7 @@ public override async Task Byte_array_filter_by_length_literal(bool async) await base.Byte_array_filter_by_length_literal(async); AssertSql( -""" + """ SELECT "s"."Id", "s"."Banner", "s"."Banner5", "s"."InternalNumber", "s"."Name" FROM "Squads" AS "s" WHERE length("s"."Banner") = 2 diff --git a/test/EFCore.Sqlite.FunctionalTests/Update/JsonUpdateSqliteTest.cs b/test/EFCore.Sqlite.FunctionalTests/Update/JsonUpdateSqliteTest.cs index 7534891a03d..019b8bd43d8 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Update/JsonUpdateSqliteTest.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Update/JsonUpdateSqliteTest.cs @@ -122,7 +122,7 @@ public override async Task Add_entity_with_json() await base.Add_entity_with_json(); AssertSql( -""" + """ @p0='{"Name":"RootName","Names":null,"Number":42,"Numbers":null,"OwnedCollectionBranch":[],"OwnedReferenceBranch":{"Date":"2010-10-10 00:00:00","Enum":2,"Enums":null,"Fraction":"42.42","NullableEnum":null,"NullableEnums":null,"OwnedCollectionLeaf":[{"SomethingSomething":"ss1"},{"SomethingSomething":"ss2"}],"OwnedReferenceLeaf":{"SomethingSomething":"ss3"}}}' (Nullable = false) (Size = 354) @p1='[]' (Nullable = false) (Size = 2) @p2='2' diff --git a/test/EFCore.VisualBasic.FunctionalTests/NorthwindQueryVisualBasicTest.vb b/test/EFCore.VisualBasic.FunctionalTests/NorthwindQueryVisualBasicTest.vb index eefd57da3ed..a1138b05e17 100644 --- a/test/EFCore.VisualBasic.FunctionalTests/NorthwindQueryVisualBasicTest.vb +++ b/test/EFCore.VisualBasic.FunctionalTests/NorthwindQueryVisualBasicTest.vb @@ -51,7 +51,7 @@ WHERE [c].[CustomerID] <= N'ALFKI'") AssertSql( "SELECT [p].[ProductID], [p].[Discontinued], [p].[ProductName], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock] FROM [Products] AS [p] -WHERE [p].[UnitsInStock] + CAST(1 AS smallint) = CAST(102 AS smallint)") +WHERE [p].[UnitsInStock] + 1 = 102") End Sub