diff --git a/test/EFCore.Jet.FunctionalTests/Query/NorthwindAggregateOperatorsQueryJetTest.ResultOperators.cs b/test/EFCore.Jet.FunctionalTests/Query/NorthwindAggregateOperatorsQueryJetTest.ResultOperators.cs index 52b2c8a..0381442 100644 --- a/test/EFCore.Jet.FunctionalTests/Query/NorthwindAggregateOperatorsQueryJetTest.ResultOperators.cs +++ b/test/EFCore.Jet.FunctionalTests/Query/NorthwindAggregateOperatorsQueryJetTest.ResultOperators.cs @@ -22,8 +22,8 @@ namespace EntityFrameworkCore.Jet.FunctionalTests.Query } protected override bool CanExecuteQueryString - => true; - + => false; + public override async Task Select_All(bool async) { await base.Select_All(async); @@ -659,14 +659,14 @@ WHERE `c`.`CustomerID` = 'ALFKI'"); await base.FirstOrDefault_inside_subquery_gets_server_evaluated(isAsync); // issue #15994 -// 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` = 'ALFKI') AND (( -// SELECT TOP 1 `o`.`CustomerID` -// FROM `Orders` AS `o` -// WHERE (`c`.`CustomerID` = `o`.`CustomerID`) AND (`o`.`CustomerID` = 'ALFKI') -//) = 'ALFKI')"); + // 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` = 'ALFKI') AND (( + // SELECT TOP 1 `o`.`CustomerID` + // FROM `Orders` AS `o` + // WHERE (`c`.`CustomerID` = `o`.`CustomerID`) AND (`o`.`CustomerID` = 'ALFKI') + //) = 'ALFKI')"); } public override async Task Multiple_collection_navigation_with_FirstOrDefault_chained(bool isAsync) @@ -708,20 +708,20 @@ ORDER BY `od`.`ProductID`"); await base.Multiple_collection_navigation_with_FirstOrDefault_chained_projecting_scalar(isAsync); // issue #15994 -// AssertSql( -// $@"SELECT ( -// SELECT TOP 1 `od`.`ProductID` -// FROM `Order Details` AS `od` -// WHERE `od`.`OrderID` = COALESCE(( -// SELECT TOP 1 `o`.`OrderID` -// FROM `Orders` AS `o` -// WHERE `c`.`CustomerID` = `o`.`CustomerID` -// ORDER BY `o`.`OrderID` -// ), 0) -// ORDER BY `od`.`ProductID` -//) -//FROM `Customers` AS `c` -//ORDER BY `c`.`CustomerID`"); + // AssertSql( + // $@"SELECT ( + // SELECT TOP 1 `od`.`ProductID` + // FROM `Order Details` AS `od` + // WHERE `od`.`OrderID` = COALESCE(( + // SELECT TOP 1 `o`.`OrderID` + // FROM `Orders` AS `o` + // WHERE `c`.`CustomerID` = `o`.`CustomerID` + // ORDER BY `o`.`OrderID` + // ), 0) + // ORDER BY `od`.`ProductID` + //) + //FROM `Customers` AS `c` + //ORDER BY `c`.`CustomerID`"); } public override async Task First_inside_subquery_gets_client_evaluated(bool isAsync) @@ -989,10 +989,10 @@ WHERE `c`.`CustomerID` IN ('ALFKI', 'ABCDE') AND `c`.`CustomerID` IN ('ABCDE', ' await base.Contains_with_local_collection_complex_predicate_or(isAsync); // issue #15994 -// 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 ('ABCDE', 'ALFKI', 'ALFKI', 'ABCDE')"); + // 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 ('ABCDE', 'ALFKI', 'ALFKI', 'ABCDE')"); } public override async Task Contains_with_local_collection_complex_predicate_not_matching_ins1(bool isAsync) @@ -1000,10 +1000,10 @@ WHERE `c`.`CustomerID` IN ('ALFKI', 'ABCDE') AND `c`.`CustomerID` IN ('ABCDE', ' await base.Contains_with_local_collection_complex_predicate_not_matching_ins1(isAsync); // issue #15994 -// 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 ('ALFKI', 'ABCDE') OR `c`.`CustomerID` NOT IN ('ABCDE', 'ALFKI')"); + // 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 ('ALFKI', 'ABCDE') OR `c`.`CustomerID` NOT IN ('ABCDE', 'ALFKI')"); } public override async Task Contains_with_local_collection_complex_predicate_not_matching_ins2(bool isAsync) @@ -1011,10 +1011,10 @@ WHERE `c`.`CustomerID` IN ('ALFKI', 'ABCDE') AND `c`.`CustomerID` IN ('ABCDE', ' await base.Contains_with_local_collection_complex_predicate_not_matching_ins2(isAsync); // issue #15944 -// 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 ('ABCDE', 'ALFKI') AND `c`.`CustomerID` NOT IN ('ALFKI', 'ABCDE')"); + // 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 ('ABCDE', 'ALFKI') AND `c`.`CustomerID` NOT IN ('ALFKI', 'ABCDE')"); } public override async Task Contains_with_local_collection_sql_injection(bool isAsync) @@ -1051,16 +1051,16 @@ FROM `Customers` AS `c`"); await base.Contains_top_level(isAsync); // issue #15994 -// AssertSql( -// $@"{AssertSqlHelper.Declaration("@__p_0='ALFKI' (Size = 4000)")} + // AssertSql( + // $@"{AssertSqlHelper.Declaration("@__p_0='ALFKI' (Size = 4000)")} -//SELECT CASE -// WHEN @__p_0 IN ( -// SELECT `c`.`CustomerID` -// FROM `Customers` AS `c` -// ) -// THEN True ELSE False -//END"); + //SELECT CASE + // WHEN @__p_0 IN ( + // SELECT `c`.`CustomerID` + // FROM `Customers` AS `c` + // ) + // THEN True ELSE False + //END"); } public override async Task Contains_with_local_anonymous_type_array_closure(bool isAsync) @@ -1097,7 +1097,7 @@ LEFT JOIN `Customers` AS `c` ON `o`.`CustomerID` = `c`.`CustomerID` ORDER BY `o`.`OrderID`"); } - + public override async Task Average_with_non_matching_types_in_projection_doesnt_produce_second_explicit_cast(bool isAsync) { await base.Average_with_non_matching_types_in_projection_doesnt_produce_second_explicit_cast(isAsync); @@ -1159,7 +1159,7 @@ FROM ( ORDER BY `t`.`CustomerID` DESC"); } - public override async Task Contains_over_entityType_should_rewrite_to_identity_equality(bool async) + public override async Task Contains_over_entityType_should_rewrite_to_identity_equality(bool async) { await base.Contains_over_entityType_should_rewrite_to_identity_equality(async); @@ -1182,15 +1182,16 @@ FROM (SELECT COUNT(*) FROM `#Dual`)"); await base.List_Contains_over_entityType_should_rewrite_to_identity_equality(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__entity_equality_someOrder_0_OrderID='10248' (Nullable = 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 {AssertSqlHelper.Parameter("@__entity_equality_someOrder_0_OrderID")} IN ( - SELECT `o`.`OrderID` - FROM `Orders` AS `o` - WHERE `c`.`CustomerID` = `o`.`CustomerID` -)"); + """ + @__entity_equality_someOrder_0_OrderID='10248' (Nullable = 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 EXISTS ( + SELECT 1 + FROM `Orders` AS `o` + WHERE `c`.`CustomerID` = `o`.`CustomerID` AND `o`.`OrderID` = @__entity_equality_someOrder_0_OrderID) + """); } public override async Task List_Contains_with_constant_list(bool isAsync) @@ -1252,7 +1253,7 @@ WHERE `c`.`CustomerID` = 'ALFKI'"); FROM `Customers` AS `c` WHERE `c`.`CustomerID` = 'ALFKI'"); } - + public override async Task Project_constant_Sum(bool isAsync) { await base.Project_constant_Sum(isAsync); diff --git a/test/EFCore.Jet.FunctionalTests/Query/NorthwindJoinQueryJetTest.cs b/test/EFCore.Jet.FunctionalTests/Query/NorthwindJoinQueryJetTest.cs index abe2cc9..20ce639 100644 --- a/test/EFCore.Jet.FunctionalTests/Query/NorthwindJoinQueryJetTest.cs +++ b/test/EFCore.Jet.FunctionalTests/Query/NorthwindJoinQueryJetTest.cs @@ -21,7 +21,7 @@ namespace EntityFrameworkCore.Jet.FunctionalTests.Query } protected override bool CanExecuteQueryString - => true; + => false; public override async Task Join_customers_orders_projection(bool isAsync) { @@ -119,16 +119,16 @@ WHERE `o`.`CustomerID` = 'ALFKI' await base.Join_customers_orders_with_subquery_anonymous_property_method_with_take(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__p_0='5'")} - -SELECT `t`.`OrderID`, `t`.`CustomerID`, `t`.`EmployeeID`, `t`.`OrderDate` -FROM `Customers` AS `c` -INNER JOIN ( - SELECT TOP {AssertSqlHelper.Parameter("@__p_0")} `o`.`OrderID`, `o`.`CustomerID`, `o`.`EmployeeID`, `o`.`OrderDate` - FROM `Orders` AS `o` - ORDER BY `o`.`OrderID` -) AS `t` ON `c`.`CustomerID` = `t`.`CustomerID` -WHERE `t`.`CustomerID` = 'ALFKI'"); + """ + SELECT `t`.`OrderID`, `t`.`CustomerID`, `t`.`EmployeeID`, `t`.`OrderDate` + FROM `Customers` AS `c` + INNER JOIN ( + SELECT TOP 5 `o`.`OrderID`, `o`.`CustomerID`, `o`.`EmployeeID`, `o`.`OrderDate` + FROM `Orders` AS `o` + ORDER BY `o`.`OrderID` + ) AS `t` ON `c`.`CustomerID` = `t`.`CustomerID` + WHERE `t`.`CustomerID` = 'ALFKI' + """); } public override async Task Join_customers_orders_with_subquery_predicate(bool isAsync) @@ -151,17 +151,17 @@ WHERE `t`.`CustomerID` = 'ALFKI'"); await base.Join_customers_orders_with_subquery_predicate_with_take(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__p_0='5'")} - -SELECT `c`.`ContactName`, `t`.`OrderID` -FROM `Customers` AS `c` -INNER JOIN ( - SELECT TOP {AssertSqlHelper.Parameter("@__p_0")} `o`.`OrderID`, `o`.`CustomerID`, `o`.`EmployeeID`, `o`.`OrderDate` - FROM `Orders` AS `o` - WHERE `o`.`OrderID` > 0 - ORDER BY `o`.`OrderID` -) AS `t` ON `c`.`CustomerID` = `t`.`CustomerID` -WHERE `t`.`CustomerID` = 'ALFKI'"); + """ + SELECT `c`.`ContactName`, `t`.`OrderID` + FROM `Customers` AS `c` + INNER JOIN ( + SELECT TOP 5 `o`.`OrderID`, `o`.`CustomerID` + FROM `Orders` AS `o` + WHERE `o`.`OrderID` > 0 + ORDER BY `o`.`OrderID` + ) AS `t` ON `c`.`CustomerID` = `t`.`CustomerID` + WHERE `t`.`CustomerID` = 'ALFKI' + """); } public override async Task Join_composite_key(bool isAsync) @@ -260,15 +260,15 @@ ORDER BY `c`.`City`"); await base.GroupJoin_simple_subquery(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__p_0='4'")} - -SELECT `t`.`OrderID`, `t`.`CustomerID`, `t`.`EmployeeID`, `t`.`OrderDate` -FROM `Customers` AS `c` -INNER JOIN ( - SELECT TOP {AssertSqlHelper.Parameter("@__p_0")} `o`.`OrderID`, `o`.`CustomerID`, `o`.`EmployeeID`, `o`.`OrderDate` - FROM `Orders` AS `o` - ORDER BY `o`.`OrderID` -) AS `t` ON `c`.`CustomerID` = `t`.`CustomerID`"); + """ + SELECT `t`.`OrderID`, `t`.`CustomerID`, `t`.`EmployeeID`, `t`.`OrderDate` + FROM `Customers` AS `c` + INNER JOIN ( + SELECT TOP 4 `o`.`OrderID`, `o`.`CustomerID`, `o`.`EmployeeID`, `o`.`OrderDate` + FROM `Orders` AS `o` + ORDER BY `o`.`OrderID` + ) AS `t` ON `c`.`CustomerID` = `t`.`CustomerID` + """); } public override async Task GroupJoin_DefaultIfEmpty(bool isAsync) @@ -313,14 +313,16 @@ LEFT JOIN ( await base.GroupJoin_DefaultIfEmpty3(isAsync); AssertSql( - @"SELECT `o`.`OrderID`, `o`.`CustomerID`, `o`.`EmployeeID`, `o`.`OrderDate` -FROM ( - SELECT 1 `c`.`CustomerID` - FROM `Customers` AS `c` - ORDER BY `c`.`CustomerID` -) AS `t` -LEFT JOIN `Orders` AS `o` ON `t`.`CustomerID` = `o`.`CustomerID` -ORDER BY `t`.`CustomerID`"); + """ + SELECT `o`.`OrderID`, `o`.`CustomerID`, `o`.`EmployeeID`, `o`.`OrderDate` + FROM ( + SELECT TOP 1 `c`.`CustomerID` + FROM `Customers` AS `c` + ORDER BY `c`.`CustomerID` + ) AS `t` + LEFT JOIN `Orders` AS `o` ON `t`.`CustomerID` = `o`.`CustomerID` + ORDER BY `t`.`CustomerID` + """); } public override async Task GroupJoin_Where(bool isAsync) @@ -380,7 +382,7 @@ WHERE (`o0`.`OrderID` IS NOT NULL) AND `o0`.`CustomerID` = 'ALFKI' FROM `Customers` AS `c` LEFT JOIN `Orders` AS `o` ON `c`.`CustomerID` = `o`.`CustomerID`"); } - + public override async Task GroupJoin_SelectMany_subquery_with_filter(bool isAsync) { await base.GroupJoin_SelectMany_subquery_with_filter(isAsync); @@ -437,19 +439,19 @@ ORDER BY `c`.`CustomerID`"); await base.GroupJoin_Subquery_with_Take_Then_SelectMany_Where(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__p_0='100'")} - -SELECT `c`.`CustomerID`, `t0`.`OrderID` -FROM `Customers` AS `c` -INNER JOIN ( - SELECT `t`.`OrderID`, `t`.`CustomerID`, `t`.`EmployeeID`, `t`.`OrderDate` - FROM ( - SELECT TOP {AssertSqlHelper.Parameter("@__p_0")} `o`.`OrderID`, `o`.`CustomerID`, `o`.`EmployeeID`, `o`.`OrderDate` - FROM `Orders` AS `o` - ORDER BY `o`.`OrderID` - ) AS `t` - WHERE `t`.`CustomerID` IS NOT NULL AND (`t`.`CustomerID` LIKE 'A%') -) AS `t0` ON `c`.`CustomerID` = `t0`.`CustomerID`"); + """ + SELECT `c`.`CustomerID`, `t0`.`OrderID` + FROM `Customers` AS `c` + INNER JOIN ( + SELECT `t`.`OrderID`, `t`.`CustomerID` + FROM ( + SELECT TOP 100 `o`.`OrderID`, `o`.`CustomerID` + FROM `Orders` AS `o` + ORDER BY `o`.`OrderID` + ) AS `t` + WHERE (`t`.`CustomerID` IS NOT NULL) AND (`t`.`CustomerID` LIKE 'A%') + ) AS `t0` ON `c`.`CustomerID` = `t0`.`CustomerID` + """); } [ConditionalTheory(Skip = "Can be supported after rearranging CROSS JOIN/JOIN expressions.")] @@ -457,7 +459,7 @@ INNER JOIN ( { return base.GroupJoin_subquery_projection_outer_mixed(isAsync); } - + private void AssertSql(params string[] expected) => Fixture.TestSqlLoggerFactory.AssertBaseline(expected); diff --git a/test/EFCore.Jet.FunctionalTests/Query/NorthwindKeylessEntitiesQueryJetTest.cs b/test/EFCore.Jet.FunctionalTests/Query/NorthwindKeylessEntitiesQueryJetTest.cs index 86b2a72..23c147d 100644 --- a/test/EFCore.Jet.FunctionalTests/Query/NorthwindKeylessEntitiesQueryJetTest.cs +++ b/test/EFCore.Jet.FunctionalTests/Query/NorthwindKeylessEntitiesQueryJetTest.cs @@ -22,7 +22,7 @@ namespace EntityFrameworkCore.Jet.FunctionalTests.Query } protected override bool CanExecuteQueryString - => true; + => false; [ConditionalTheory] public override async Task KeylessEntity_simple(bool isAsync) diff --git a/test/EFCore.Jet.FunctionalTests/Query/NorthwindSelectQueryJetTest.cs b/test/EFCore.Jet.FunctionalTests/Query/NorthwindSelectQueryJetTest.cs index 2e8682e..d851bdd 100644 --- a/test/EFCore.Jet.FunctionalTests/Query/NorthwindSelectQueryJetTest.cs +++ b/test/EFCore.Jet.FunctionalTests/Query/NorthwindSelectQueryJetTest.cs @@ -21,7 +21,7 @@ namespace EntityFrameworkCore.Jet.FunctionalTests.Query } protected override bool CanExecuteQueryString - => true; + => false; public override async Task Projection_when_arithmetic_expression_precedence(bool isAsync) { @@ -46,20 +46,20 @@ FROM `Orders` AS `o`"); await base.Projection_when_arithmetic_mixed(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__p_0='10'")} - -SELECT CAST(`t0`.`EmployeeID` AS bigint) + CAST(`t`.`OrderID` AS bigint) AS `Add`, `t`.`OrderID`, `t`.`CustomerID`, `t`.`EmployeeID`, `t`.`OrderDate`, 42 AS `Literal`, `t0`.`EmployeeID`, `t0`.`City`, `t0`.`Country`, `t0`.`FirstName`, `t0`.`ReportsTo`, `t0`.`Title` -FROM ( - SELECT TOP {AssertSqlHelper.Parameter("@__p_0")} `o`.`OrderID`, `o`.`CustomerID`, `o`.`EmployeeID`, `o`.`OrderDate` - FROM `Orders` AS `o` - ORDER BY `o`.`OrderID` -) AS `t`, -( - SELECT TOP 5 `e`.`EmployeeID`, `e`.`City`, `e`.`Country`, `e`.`FirstName`, `e`.`ReportsTo`, `e`.`Title` - FROM `Employees` AS `e` - ORDER BY `e`.`EmployeeID` -) AS `t0` -ORDER BY `t`.`OrderID`"); + """ + SELECT CLNG(`t0`.`EmployeeID`) + CLNG(`t`.`OrderID`) AS `Add`, `t`.`OrderID`, `t`.`CustomerID`, `t`.`EmployeeID`, `t`.`OrderDate`, 42 AS `Literal`, `t0`.`EmployeeID`, `t0`.`City`, `t0`.`Country`, `t0`.`FirstName`, `t0`.`ReportsTo`, `t0`.`Title` + FROM ( + SELECT TOP 10 `o`.`OrderID`, `o`.`CustomerID`, `o`.`EmployeeID`, `o`.`OrderDate` + FROM `Orders` AS `o` + ORDER BY `o`.`OrderID` + ) AS `t`, + ( + SELECT TOP 5 `e`.`EmployeeID`, `e`.`City`, `e`.`Country`, `e`.`FirstName`, `e`.`ReportsTo`, `e`.`Title` + FROM `Employees` AS `e` + ORDER BY `e`.`EmployeeID` + ) AS `t0` + ORDER BY `t`.`OrderID` + """); } public override async Task Projection_when_null_value(bool isAsync) @@ -245,10 +245,10 @@ FROM `Customers` AS `c`"); await base.Select_scalar_primitive_after_take(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__p_0='9'")} - -SELECT TOP {AssertSqlHelper.Parameter("@__p_0")} `e`.`EmployeeID` -FROM `Employees` AS `e`"); + """ + SELECT TOP 9 `e`.`EmployeeID` + FROM `Employees` AS `e` + """); } public override async Task Select_project_filter(bool isAsync) @@ -1488,10 +1488,11 @@ ORDER BY `c`.`CustomerID`"); await base.Projection_take_projection_doesnt_project_intermittent_column(async); AssertSql( - @"@__p_0='10' -SELECT TOP(@__p_0) (`c`.`CustomerID` + ' ') + COALESCE(`c`.`City`, '') AS `Aggregate` -FROM `Customers` AS `c` -ORDER BY `c`.`CustomerID`"); + """ + SELECT TOP 10 (`c`.`CustomerID` & ' ') & IIF(`c`.`City` IS NULL, '', `c`.`City`) AS `Aggregate` + FROM `Customers` AS `c` + ORDER BY `c`.`CustomerID` + """); } public override async Task Projection_skip_projection_doesnt_project_intermittent_column(bool async) @@ -1523,15 +1524,16 @@ FROM ( await base.Projection_take_predicate_projection(async); AssertSql( - @"@__p_0='10' -SELECT (`t`.`CustomerID` + ' ') + COALESCE(`t`.`City`, '') AS `Aggregate` -FROM ( - SELECT TOP(@__p_0) `c`.`CustomerID`, `c`.`City` - FROM `Customers` AS `c` - ORDER BY `c`.`CustomerID` -) AS `t` -WHERE `t`.`CustomerID` LIKE 'A%' -ORDER BY `t`.`CustomerID`"); + """ + SELECT (`t`.`CustomerID` & ' ') & IIF(`t`.`City` IS NULL, '', `t`.`City`) AS `Aggregate` + FROM ( + SELECT TOP 10 `c`.`CustomerID`, `c`.`City` + FROM `Customers` AS `c` + ORDER BY `c`.`CustomerID` + ) AS `t` + WHERE `t`.`CustomerID` LIKE 'A%' + ORDER BY `t`.`CustomerID` + """); } public override async Task Do_not_erase_projection_mapping_when_adding_single_projection(bool async) diff --git a/test/EFCore.Jet.FunctionalTests/Query/NorthwindSetOperationsQueryJetTest.cs b/test/EFCore.Jet.FunctionalTests/Query/NorthwindSetOperationsQueryJetTest.cs index 4dc56e9..6848511 100644 --- a/test/EFCore.Jet.FunctionalTests/Query/NorthwindSetOperationsQueryJetTest.cs +++ b/test/EFCore.Jet.FunctionalTests/Query/NorthwindSetOperationsQueryJetTest.cs @@ -23,7 +23,7 @@ namespace EntityFrameworkCore.Jet.FunctionalTests.Query } protected override bool CanExecuteQueryString - => true; + => false; public override async Task Union(bool isAsync) { @@ -86,20 +86,27 @@ WHERE CHARINDEX('Thomas', `c0`.`ContactName`) > 0"); await base.Union_OrderBy_Skip_Take(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__p_0='1'")} - -SELECT `t`.`CustomerID`, `t`.`Address`, `t`.`City`, `t`.`CompanyName`, `t`.`ContactName`, `t`.`ContactTitle`, `t`.`Country`, `t`.`Fax`, `t`.`Phone`, `t`.`PostalCode`, `t`.`Region` -FROM ( - 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` = 'Berlin' - UNION - SELECT `c0`.`CustomerID`, `c0`.`Address`, `c0`.`City`, `c0`.`CompanyName`, `c0`.`ContactName`, `c0`.`ContactTitle`, `c0`.`Country`, `c0`.`Fax`, `c0`.`Phone`, `c0`.`PostalCode`, `c0`.`Region` - FROM `Customers` AS `c0` - WHERE `c0`.`City` = 'London' -) AS `t` -ORDER BY `t`.`ContactName` -SKIP {AssertSqlHelper.Parameter("@__p_0")} FETCH NEXT {AssertSqlHelper.Parameter("@__p_0")} ROWS ONLY"); + """ + SELECT `t1`.`CustomerID`, `t1`.`Address`, `t1`.`City`, `t1`.`CompanyName`, `t1`.`ContactName`, `t1`.`ContactTitle`, `t1`.`Country`, `t1`.`Fax`, `t1`.`Phone`, `t1`.`PostalCode`, `t1`.`Region` + FROM ( + SELECT TOP 1 `t0`.`CustomerID`, `t0`.`Address`, `t0`.`City`, `t0`.`CompanyName`, `t0`.`ContactName`, `t0`.`ContactTitle`, `t0`.`Country`, `t0`.`Fax`, `t0`.`Phone`, `t0`.`PostalCode`, `t0`.`Region` + FROM ( + SELECT TOP 2 `t`.`CustomerID`, `t`.`Address`, `t`.`City`, `t`.`CompanyName`, `t`.`ContactName`, `t`.`ContactTitle`, `t`.`Country`, `t`.`Fax`, `t`.`Phone`, `t`.`PostalCode`, `t`.`Region` + FROM ( + 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` = 'Berlin' + UNION + SELECT `c0`.`CustomerID`, `c0`.`Address`, `c0`.`City`, `c0`.`CompanyName`, `c0`.`ContactName`, `c0`.`ContactTitle`, `c0`.`Country`, `c0`.`Fax`, `c0`.`Phone`, `c0`.`PostalCode`, `c0`.`Region` + FROM `Customers` AS `c0` + WHERE `c0`.`City` = 'London' + ) AS `t` + ORDER BY `t`.`ContactName` + ) AS `t0` + ORDER BY `t0`.`ContactName` DESC + ) AS `t1` + ORDER BY `t1`.`ContactName` + """); } public override async Task Union_Where(bool isAsync) @@ -190,33 +197,33 @@ WHERE CHARINDEX('Thomas', `c1`.`ContactName`) > 0"); await base.Union_Take_Union_Take(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__p_0='1'")} - -SELECT `t2`.`CustomerID`, `t2`.`Address`, `t2`.`City`, `t2`.`CompanyName`, `t2`.`ContactName`, `t2`.`ContactTitle`, `t2`.`Country`, `t2`.`Fax`, `t2`.`Phone`, `t2`.`PostalCode`, `t2`.`Region` -FROM ( - SELECT TOP {AssertSqlHelper.Parameter("@__p_0")} `t1`.`CustomerID`, `t1`.`Address`, `t1`.`City`, `t1`.`CompanyName`, `t1`.`ContactName`, `t1`.`ContactTitle`, `t1`.`Country`, `t1`.`Fax`, `t1`.`Phone`, `t1`.`PostalCode`, `t1`.`Region` + """ + SELECT `t2`.`CustomerID`, `t2`.`Address`, `t2`.`City`, `t2`.`CompanyName`, `t2`.`ContactName`, `t2`.`ContactTitle`, `t2`.`Country`, `t2`.`Fax`, `t2`.`Phone`, `t2`.`PostalCode`, `t2`.`Region` FROM ( - SELECT `t0`.`CustomerID`, `t0`.`Address`, `t0`.`City`, `t0`.`CompanyName`, `t0`.`ContactName`, `t0`.`ContactTitle`, `t0`.`Country`, `t0`.`Fax`, `t0`.`Phone`, `t0`.`PostalCode`, `t0`.`Region` + SELECT TOP 1 `t1`.`CustomerID`, `t1`.`Address`, `t1`.`City`, `t1`.`CompanyName`, `t1`.`ContactName`, `t1`.`ContactTitle`, `t1`.`Country`, `t1`.`Fax`, `t1`.`Phone`, `t1`.`PostalCode`, `t1`.`Region` FROM ( - SELECT TOP {AssertSqlHelper.Parameter("@__p_0")} `t`.`CustomerID`, `t`.`Address`, `t`.`City`, `t`.`CompanyName`, `t`.`ContactName`, `t`.`ContactTitle`, `t`.`Country`, `t`.`Fax`, `t`.`Phone`, `t`.`PostalCode`, `t`.`Region` + SELECT `t0`.`CustomerID`, `t0`.`Address`, `t0`.`City`, `t0`.`CompanyName`, `t0`.`ContactName`, `t0`.`ContactTitle`, `t0`.`Country`, `t0`.`Fax`, `t0`.`Phone`, `t0`.`PostalCode`, `t0`.`Region` FROM ( - 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` = 'Berlin' - UNION - SELECT `c0`.`CustomerID`, `c0`.`Address`, `c0`.`City`, `c0`.`CompanyName`, `c0`.`ContactName`, `c0`.`ContactTitle`, `c0`.`Country`, `c0`.`Fax`, `c0`.`Phone`, `c0`.`PostalCode`, `c0`.`Region` - FROM `Customers` AS `c0` - WHERE `c0`.`City` = 'London' - ) AS `t` - ORDER BY `t`.`CustomerID` - ) AS `t0` - UNION - SELECT `c1`.`CustomerID`, `c1`.`Address`, `c1`.`City`, `c1`.`CompanyName`, `c1`.`ContactName`, `c1`.`ContactTitle`, `c1`.`Country`, `c1`.`Fax`, `c1`.`Phone`, `c1`.`PostalCode`, `c1`.`Region` - FROM `Customers` AS `c1` - WHERE `c1`.`City` = 'Mannheim' - ) AS `t1` -) AS `t2` -ORDER BY `t2`.`CustomerID`"); + SELECT TOP 1 `t`.`CustomerID`, `t`.`Address`, `t`.`City`, `t`.`CompanyName`, `t`.`ContactName`, `t`.`ContactTitle`, `t`.`Country`, `t`.`Fax`, `t`.`Phone`, `t`.`PostalCode`, `t`.`Region` + FROM ( + 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` = 'Berlin' + UNION + SELECT `c0`.`CustomerID`, `c0`.`Address`, `c0`.`City`, `c0`.`CompanyName`, `c0`.`ContactName`, `c0`.`ContactTitle`, `c0`.`Country`, `c0`.`Fax`, `c0`.`Phone`, `c0`.`PostalCode`, `c0`.`Region` + FROM `Customers` AS `c0` + WHERE `c0`.`City` = 'London' + ) AS `t` + ORDER BY `t`.`CustomerID` + ) AS `t0` + UNION + SELECT `c1`.`CustomerID`, `c1`.`Address`, `c1`.`City`, `c1`.`CompanyName`, `c1`.`ContactName`, `c1`.`ContactTitle`, `c1`.`Country`, `c1`.`Fax`, `c1`.`Phone`, `c1`.`PostalCode`, `c1`.`Region` + FROM `Customers` AS `c1` + WHERE `c1`.`City` = 'Mannheim' + ) AS `t1` + ) AS `t2` + ORDER BY `t2`.`CustomerID` + """); } public override async Task Select_Union(bool isAsync) @@ -307,27 +314,28 @@ ORDER BY `t`.`CompanyName` await base.Select_Union_different_fields_in_anonymous_with_subquery(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__p_0='1'")} - -{AssertSqlHelper.Declaration("@__p_1='10'")} - -SELECT `t0`.`Foo`, `t0`.`CustomerID`, `t0`.`Address`, `t0`.`City`, `t0`.`CompanyName`, `t0`.`ContactName`, `t0`.`ContactTitle`, `t0`.`Country`, `t0`.`Fax`, `t0`.`Phone`, `t0`.`PostalCode`, `t0`.`Region` -FROM ( - SELECT `t`.`Foo`, `t`.`CustomerID`, `t`.`Address`, `t`.`City`, `t`.`CompanyName`, `t`.`ContactName`, `t`.`ContactTitle`, `t`.`Country`, `t`.`Fax`, `t`.`Phone`, `t`.`PostalCode`, `t`.`Region` + """ + SELECT `t1`.`Foo`, `t1`.`CustomerID`, `t1`.`Address`, `t1`.`City`, `t1`.`CompanyName`, `t1`.`ContactName`, `t1`.`ContactTitle`, `t1`.`Country`, `t1`.`Fax`, `t1`.`Phone`, `t1`.`PostalCode`, `t1`.`Region` FROM ( - SELECT `c`.`City` AS `Foo`, `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` = 'Berlin' - UNION - SELECT `c0`.`Region` AS `Foo`, `c0`.`CustomerID`, `c0`.`Address`, `c0`.`City`, `c0`.`CompanyName`, `c0`.`ContactName`, `c0`.`ContactTitle`, `c0`.`Country`, `c0`.`Fax`, `c0`.`Phone`, `c0`.`PostalCode`, `c0`.`Region` - FROM `Customers` AS `c0` - WHERE `c0`.`City` = 'London' - ) AS `t` - ORDER BY `t`.`Foo` - SKIP {AssertSqlHelper.Parameter("@__p_0")} FETCH NEXT {AssertSqlHelper.Parameter("@__p_1")} ROWS ONLY -) AS `t0` -WHERE `t0`.`Foo` = 'Berlin' -ORDER BY `t0`.`Foo`"); + SELECT TOP 10 `t0`.`Foo`, `t0`.`CustomerID`, `t0`.`Address`, `t0`.`City`, `t0`.`CompanyName`, `t0`.`ContactName`, `t0`.`ContactTitle`, `t0`.`Country`, `t0`.`Fax`, `t0`.`Phone`, `t0`.`PostalCode`, `t0`.`Region` + FROM ( + SELECT TOP 11 `t`.`Foo`, `t`.`CustomerID`, `t`.`Address`, `t`.`City`, `t`.`CompanyName`, `t`.`ContactName`, `t`.`ContactTitle`, `t`.`Country`, `t`.`Fax`, `t`.`Phone`, `t`.`PostalCode`, `t`.`Region` + FROM ( + SELECT `c`.`City` AS `Foo`, `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` = 'Berlin' + UNION + SELECT `c0`.`Region` AS `Foo`, `c0`.`CustomerID`, `c0`.`Address`, `c0`.`City`, `c0`.`CompanyName`, `c0`.`ContactName`, `c0`.`ContactTitle`, `c0`.`Country`, `c0`.`Fax`, `c0`.`Phone`, `c0`.`PostalCode`, `c0`.`Region` + FROM `Customers` AS `c0` + WHERE `c0`.`City` = 'London' + ) AS `t` + ORDER BY `t`.`Foo` + ) AS `t0` + ORDER BY `t0`.`Foo` DESC + ) AS `t1` + WHERE `t1`.`Foo` = 'Berlin' + ORDER BY `t1`.`Foo` + """); } public override async Task Union_Include(bool isAsync) @@ -434,19 +442,21 @@ FROM `Customers` AS `c0`"); await base.OrderBy_Take_Union(isAsync); AssertSql( - @"SELECT `t`.`CustomerID`, `t`.`Address`, `t`.`City`, `t`.`CompanyName`, `t`.`ContactName`, `t`.`ContactTitle`, `t`.`Country`, `t`.`Fax`, `t`.`Phone`, `t`.`PostalCode`, `t`.`Region` -FROM ( - SELECT TOP 1 `c`.`CustomerID`, `c`.`Address`, `c`.`City`, `c`.`CompanyName`, `c`.`ContactName`, `c`.`ContactTitle`, `c`.`Country`, `c`.`Fax`, `c`.`Phone`, `c`.`PostalCode`, `c`.`Region` - FROM `Customers` AS `c` - ORDER BY `c`.`ContactName` -) AS `t` -UNION -SELECT `t0`.`CustomerID`, `t0`.`Address`, `t0`.`City`, `t0`.`CompanyName`, `t0`.`ContactName`, `t0`.`ContactTitle`, `t0`.`Country`, `t0`.`Fax`, `t0`.`Phone`, `t0`.`PostalCode`, `t0`.`Region` -FROM ( - SELECT TOP 1 `c0`.`CustomerID`, `c0`.`Address`, `c0`.`City`, `c0`.`CompanyName`, `c0`.`ContactName`, `c0`.`ContactTitle`, `c0`.`Country`, `c0`.`Fax`, `c0`.`Phone`, `c0`.`PostalCode`, `c0`.`Region` - FROM `Customers` AS `c0` - ORDER BY `c0`.`ContactName` -) AS `t0`"); + """ + SELECT `t`.`CustomerID`, `t`.`Address`, `t`.`City`, `t`.`CompanyName`, `t`.`ContactName`, `t`.`ContactTitle`, `t`.`Country`, `t`.`Fax`, `t`.`Phone`, `t`.`PostalCode`, `t`.`Region` + FROM ( + SELECT TOP 1 `c`.`CustomerID`, `c`.`Address`, `c`.`City`, `c`.`CompanyName`, `c`.`ContactName`, `c`.`ContactTitle`, `c`.`Country`, `c`.`Fax`, `c`.`Phone`, `c`.`PostalCode`, `c`.`Region` + FROM `Customers` AS `c` + ORDER BY `c`.`ContactName` + ) AS `t` + UNION + SELECT `t1`.`CustomerID`, `t1`.`Address`, `t1`.`City`, `t1`.`CompanyName`, `t1`.`ContactName`, `t1`.`ContactTitle`, `t1`.`Country`, `t1`.`Fax`, `t1`.`Phone`, `t1`.`PostalCode`, `t1`.`Region` + FROM ( + SELECT TOP 1 `c0`.`CustomerID`, `c0`.`Address`, `c0`.`City`, `c0`.`CompanyName`, `c0`.`ContactName`, `c0`.`ContactTitle`, `c0`.`Country`, `c0`.`Fax`, `c0`.`Phone`, `c0`.`PostalCode`, `c0`.`Region` + FROM `Customers` AS `c0` + ORDER BY `c0`.`ContactName` + ) AS `t1` + """); } private void AssertSql(params string[] expected) diff --git a/test/EFCore.Jet.FunctionalTests/Query/NorthwindWhereQueryJetTest.cs b/test/EFCore.Jet.FunctionalTests/Query/NorthwindWhereQueryJetTest.cs index a36c450..00681d9 100644 --- a/test/EFCore.Jet.FunctionalTests/Query/NorthwindWhereQueryJetTest.cs +++ b/test/EFCore.Jet.FunctionalTests/Query/NorthwindWhereQueryJetTest.cs @@ -21,7 +21,7 @@ namespace EntityFrameworkCore.Jet.FunctionalTests.Query } protected override bool CanExecuteQueryString - => true; + => false; public override async Task Where_simple(bool isAsync) { @@ -51,11 +51,13 @@ WHERE EXISTS ( var queryString = await base.Where_simple_closure(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__city_0='London' (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`.`City` = {AssertSqlHelper.Parameter("@__city_0")}"); + """ + @__city_0='London' (Size = 255) + + 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` = @__city_0 + """); return queryString; } @@ -65,11 +67,13 @@ WHERE `c`.`City` = {AssertSqlHelper.Parameter("@__city_0")}"); await base.Where_indexer_closure(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__p_0='London' (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`.`City` = {AssertSqlHelper.Parameter("@__p_0")}"); + """ + @__p_0='London' (Size = 255) + + 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` = @__p_0 + """); } public override async Task Where_dictionary_key_access_closure(bool isAsync) @@ -77,11 +81,13 @@ WHERE `c`.`City` = {AssertSqlHelper.Parameter("@__p_0")}"); await base.Where_dictionary_key_access_closure(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__get_Item_0='London' (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`.`City` = {AssertSqlHelper.Parameter("@__get_Item_0")}"); + """ + @__get_Item_0='London' (Size = 255) + + 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` = @__get_Item_0 + """); } public override async Task Where_tuple_item_closure(bool isAsync) @@ -89,11 +95,13 @@ WHERE `c`.`City` = {AssertSqlHelper.Parameter("@__get_Item_0")}"); await base.Where_tuple_item_closure(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__predicateTuple_Item2_0='London' (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`.`City` = {AssertSqlHelper.Parameter("@__predicateTuple_Item2_0")}"); + """ + @__predicateTuple_Item2_0='London' (Size = 255) + + 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` = @__predicateTuple_Item2_0 + """); } public override async Task Where_named_tuple_item_closure(bool isAsync) @@ -101,11 +109,13 @@ WHERE `c`.`City` = {AssertSqlHelper.Parameter("@__predicateTuple_Item2_0")}"); await base.Where_named_tuple_item_closure(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__predicateTuple_Item2_0='London' (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`.`City` = {AssertSqlHelper.Parameter("@__predicateTuple_Item2_0")}"); + """ + @__predicateTuple_Item2_0='London' (Size = 255) + + 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` = @__predicateTuple_Item2_0 + """); } public override async Task Where_simple_closure_constant(bool isAsync) @@ -113,11 +123,13 @@ WHERE `c`.`City` = {AssertSqlHelper.Parameter("@__predicateTuple_Item2_0")}"); await base.Where_simple_closure_constant(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__predicate_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 {AssertSqlHelper.Parameter("@__predicate_0")} = True"); + """ + @__predicate_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 @__predicate_0 = TRUE + """); } public override async Task Where_simple_closure_via_query_cache(bool isAsync) @@ -125,17 +137,21 @@ WHERE {AssertSqlHelper.Parameter("@__predicate_0")} = True"); await base.Where_simple_closure_via_query_cache(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__city_0='London' (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`.`City` = {AssertSqlHelper.Parameter("@__city_0")}", + """ + @__city_0='London' (Size = 255) + + 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` = @__city_0 + """, // - $@"{AssertSqlHelper.Declaration("@__city_0='Seattle' (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`.`City` = {AssertSqlHelper.Parameter("@__city_0")}"); + """ + @__city_0='Seattle' (Size = 255) + + 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` = @__city_0 + """); } public override async Task Where_method_call_nullable_type_closure_via_query_cache(bool isAsync) @@ -143,17 +159,21 @@ WHERE `c`.`City` = {AssertSqlHelper.Parameter("@__city_0")}"); await base.Where_method_call_nullable_type_closure_via_query_cache(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__p_0='2' (Nullable = true)")} - -SELECT `e`.`EmployeeID`, `e`.`City`, `e`.`Country`, `e`.`FirstName`, `e`.`ReportsTo`, `e`.`Title` -FROM `Employees` AS `e` -WHERE CAST(`e`.`ReportsTo` AS bigint) = {AssertSqlHelper.Parameter("@__p_0")}", + """ + @__p_0='2' (Nullable = true) + + SELECT `e`.`EmployeeID`, `e`.`City`, `e`.`Country`, `e`.`FirstName`, `e`.`ReportsTo`, `e`.`Title` + FROM `Employees` AS `e` + WHERE IIF(`e`.`ReportsTo` IS NULL, NULL, CLNG(`e`.`ReportsTo`)) = @__p_0 + """, // - $@"{AssertSqlHelper.Declaration("@__p_0='5' (Nullable = true)")} - -SELECT `e`.`EmployeeID`, `e`.`City`, `e`.`Country`, `e`.`FirstName`, `e`.`ReportsTo`, `e`.`Title` -FROM `Employees` AS `e` -WHERE CAST(`e`.`ReportsTo` AS bigint) = {AssertSqlHelper.Parameter("@__p_0")}"); + """ + @__p_0='5' (Nullable = true) + + SELECT `e`.`EmployeeID`, `e`.`City`, `e`.`Country`, `e`.`FirstName`, `e`.`ReportsTo`, `e`.`Title` + FROM `Employees` AS `e` + WHERE IIF(`e`.`ReportsTo` IS NULL, NULL, CLNG(`e`.`ReportsTo`)) = @__p_0 + """); } public override async Task Where_method_call_nullable_type_reverse_closure_via_query_cache(bool isAsync) @@ -161,17 +181,21 @@ WHERE CAST(`e`.`ReportsTo` AS bigint) = {AssertSqlHelper.Parameter("@__p_0")}"); await base.Where_method_call_nullable_type_reverse_closure_via_query_cache(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__p_0='1' (Nullable = true)")} - -SELECT `e`.`EmployeeID`, `e`.`City`, `e`.`Country`, `e`.`FirstName`, `e`.`ReportsTo`, `e`.`Title` -FROM `Employees` AS `e` -WHERE CAST(`e`.`EmployeeID` AS bigint) > {AssertSqlHelper.Parameter("@__p_0")}", + """ + @__p_0='1' (Nullable = true) + + SELECT `e`.`EmployeeID`, `e`.`City`, `e`.`Country`, `e`.`FirstName`, `e`.`ReportsTo`, `e`.`Title` + FROM `Employees` AS `e` + WHERE CLNG(`e`.`EmployeeID`) > @__p_0 + """, // - $@"{AssertSqlHelper.Declaration("@__p_0='5' (Nullable = true)")} - -SELECT `e`.`EmployeeID`, `e`.`City`, `e`.`Country`, `e`.`FirstName`, `e`.`ReportsTo`, `e`.`Title` -FROM `Employees` AS `e` -WHERE CAST(`e`.`EmployeeID` AS bigint) > {AssertSqlHelper.Parameter("@__p_0")}"); + """ + @__p_0='5' (Nullable = true) + + SELECT `e`.`EmployeeID`, `e`.`City`, `e`.`Country`, `e`.`FirstName`, `e`.`ReportsTo`, `e`.`Title` + FROM `Employees` AS `e` + WHERE CLNG(`e`.`EmployeeID`) > @__p_0 + """); } public override async Task Where_method_call_closure_via_query_cache(bool isAsync) @@ -179,17 +203,21 @@ WHERE CAST(`e`.`EmployeeID` AS bigint) > {AssertSqlHelper.Parameter("@__p_0")}") await base.Where_method_call_closure_via_query_cache(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__GetCity_0='London' (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`.`City` = {AssertSqlHelper.Parameter("@__GetCity_0")}", + """ + @__GetCity_0='London' (Size = 255) + + 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` = @__GetCity_0 + """, // - $@"{AssertSqlHelper.Declaration("@__GetCity_0='Seattle' (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`.`City` = {AssertSqlHelper.Parameter("@__GetCity_0")}"); + """ + @__GetCity_0='Seattle' (Size = 255) + + 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` = @__GetCity_0 + """); } public override async Task Where_field_access_closure_via_query_cache(bool isAsync) @@ -197,17 +225,21 @@ WHERE `c`.`City` = {AssertSqlHelper.Parameter("@__GetCity_0")}"); await base.Where_field_access_closure_via_query_cache(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__city_InstanceFieldValue_0='London' (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`.`City` = {AssertSqlHelper.Parameter("@__city_InstanceFieldValue_0")}", + """ + @__city_InstanceFieldValue_0='London' (Size = 255) + + 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` = @__city_InstanceFieldValue_0 + """, // - $@"{AssertSqlHelper.Declaration("@__city_InstanceFieldValue_0='Seattle' (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`.`City` = {AssertSqlHelper.Parameter("@__city_InstanceFieldValue_0")}"); + """ + @__city_InstanceFieldValue_0='Seattle' (Size = 255) + + 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` = @__city_InstanceFieldValue_0 + """); } public override async Task Where_property_access_closure_via_query_cache(bool isAsync) @@ -215,17 +247,21 @@ WHERE `c`.`City` = {AssertSqlHelper.Parameter("@__city_InstanceFieldValue_0")}") await base.Where_property_access_closure_via_query_cache(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__city_InstancePropertyValue_0='London' (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`.`City` = {AssertSqlHelper.Parameter("@__city_InstancePropertyValue_0")}", + """ + @__city_InstancePropertyValue_0='London' (Size = 255) + + 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` = @__city_InstancePropertyValue_0 + """, // - $@"{AssertSqlHelper.Declaration("@__city_InstancePropertyValue_0='Seattle' (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`.`City` = {AssertSqlHelper.Parameter("@__city_InstancePropertyValue_0")}"); + """ + @__city_InstancePropertyValue_0='Seattle' (Size = 255) + + 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` = @__city_InstancePropertyValue_0 + """); } public override async Task Where_static_field_access_closure_via_query_cache(bool isAsync) @@ -233,17 +269,21 @@ WHERE `c`.`City` = {AssertSqlHelper.Parameter("@__city_InstancePropertyValue_0") await base.Where_static_field_access_closure_via_query_cache(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__StaticFieldValue_0='London' (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`.`City` = {AssertSqlHelper.Parameter("@__StaticFieldValue_0")}", + """ + @__StaticFieldValue_0='London' (Size = 255) + + 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` = @__StaticFieldValue_0 + """, // - $@"{AssertSqlHelper.Declaration("@__StaticFieldValue_0='Seattle' (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`.`City` = {AssertSqlHelper.Parameter("@__StaticFieldValue_0")}"); + """ + @__StaticFieldValue_0='Seattle' (Size = 255) + + 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` = @__StaticFieldValue_0 + """); } public override async Task Where_static_property_access_closure_via_query_cache(bool isAsync) @@ -251,17 +291,21 @@ WHERE `c`.`City` = {AssertSqlHelper.Parameter("@__StaticFieldValue_0")}"); await base.Where_static_property_access_closure_via_query_cache(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__StaticPropertyValue_0='London' (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`.`City` = {AssertSqlHelper.Parameter("@__StaticPropertyValue_0")}", + """ + @__StaticPropertyValue_0='London' (Size = 255) + + 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` = @__StaticPropertyValue_0 + """, // - $@"{AssertSqlHelper.Declaration("@__StaticPropertyValue_0='Seattle' (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`.`City` = {AssertSqlHelper.Parameter("@__StaticPropertyValue_0")}"); + """ + @__StaticPropertyValue_0='Seattle' (Size = 255) + + 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` = @__StaticPropertyValue_0 + """); } public override async Task Where_nested_field_access_closure_via_query_cache(bool isAsync) @@ -269,17 +313,21 @@ WHERE `c`.`City` = {AssertSqlHelper.Parameter("@__StaticPropertyValue_0")}"); await base.Where_nested_field_access_closure_via_query_cache(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__city_Nested_InstanceFieldValue_0='London' (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`.`City` = {AssertSqlHelper.Parameter("@__city_Nested_InstanceFieldValue_0")}", + """ + @__city_Nested_InstanceFieldValue_0='London' (Size = 255) + + 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` = @__city_Nested_InstanceFieldValue_0 + """, // - $@"{AssertSqlHelper.Declaration("@__city_Nested_InstanceFieldValue_0='Seattle' (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`.`City` = {AssertSqlHelper.Parameter("@__city_Nested_InstanceFieldValue_0")}"); + """ + @__city_Nested_InstanceFieldValue_0='Seattle' (Size = 255) + + 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` = @__city_Nested_InstanceFieldValue_0 + """); } public override async Task Where_nested_property_access_closure_via_query_cache(bool isAsync) @@ -287,17 +335,21 @@ WHERE `c`.`City` = {AssertSqlHelper.Parameter("@__city_Nested_InstanceFieldValue await base.Where_nested_property_access_closure_via_query_cache(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__city_Nested_InstancePropertyValue_0='London' (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`.`City` = {AssertSqlHelper.Parameter("@__city_Nested_InstancePropertyValue_0")}", + """ + @__city_Nested_InstancePropertyValue_0='London' (Size = 255) + + 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` = @__city_Nested_InstancePropertyValue_0 + """, // - $@"{AssertSqlHelper.Declaration("@__city_Nested_InstancePropertyValue_0='Seattle' (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`.`City` = {AssertSqlHelper.Parameter("@__city_Nested_InstancePropertyValue_0")}"); + """ + @__city_Nested_InstancePropertyValue_0='Seattle' (Size = 255) + + 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` = @__city_Nested_InstancePropertyValue_0 + """); } public override async Task Where_new_instance_field_access_query_cache(bool isAsync) @@ -305,17 +357,21 @@ WHERE `c`.`City` = {AssertSqlHelper.Parameter("@__city_Nested_InstancePropertyVa await base.Where_new_instance_field_access_query_cache(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__InstanceFieldValue_0='London' (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`.`City` = {AssertSqlHelper.Parameter("@__InstanceFieldValue_0")}", + """ + @__InstanceFieldValue_0='London' (Size = 255) + + 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` = @__InstanceFieldValue_0 + """, // - $@"{AssertSqlHelper.Declaration("@__InstanceFieldValue_0='Seattle' (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`.`City` = {AssertSqlHelper.Parameter("@__InstanceFieldValue_0")}"); + """ + @__InstanceFieldValue_0='Seattle' (Size = 255) + + 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` = @__InstanceFieldValue_0 + """); } public override async Task Where_new_instance_field_access_closure_via_query_cache(bool isAsync) @@ -323,17 +379,21 @@ WHERE `c`.`City` = {AssertSqlHelper.Parameter("@__InstanceFieldValue_0")}"); await base.Where_new_instance_field_access_closure_via_query_cache(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__InstanceFieldValue_0='London' (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`.`City` = {AssertSqlHelper.Parameter("@__InstanceFieldValue_0")}", + """ + @__InstanceFieldValue_0='London' (Size = 255) + + 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` = @__InstanceFieldValue_0 + """, // - $@"{AssertSqlHelper.Declaration("@__InstanceFieldValue_0='Seattle' (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`.`City` = {AssertSqlHelper.Parameter("@__InstanceFieldValue_0")}"); + """ + @__InstanceFieldValue_0='Seattle' (Size = 255) + + 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` = @__InstanceFieldValue_0 + """); } public override async Task Where_simple_closure_via_query_cache_nullable_type(bool isAsync) @@ -341,21 +401,27 @@ WHERE `c`.`City` = {AssertSqlHelper.Parameter("@__InstanceFieldValue_0")}"); await base.Where_simple_closure_via_query_cache_nullable_type(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__p_0='2' (Nullable = true)")} - -SELECT `e`.`EmployeeID`, `e`.`City`, `e`.`Country`, `e`.`FirstName`, `e`.`ReportsTo`, `e`.`Title` -FROM `Employees` AS `e` -WHERE CAST(`e`.`ReportsTo` AS bigint) = {AssertSqlHelper.Parameter("@__p_0")}", + """ + @__p_0='2' (Nullable = true) + + SELECT `e`.`EmployeeID`, `e`.`City`, `e`.`Country`, `e`.`FirstName`, `e`.`ReportsTo`, `e`.`Title` + FROM `Employees` AS `e` + WHERE IIF(`e`.`ReportsTo` IS NULL, NULL, CLNG(`e`.`ReportsTo`)) = @__p_0 + """, // - $@"{AssertSqlHelper.Declaration("@__p_0='5' (Nullable = true)")} - -SELECT `e`.`EmployeeID`, `e`.`City`, `e`.`Country`, `e`.`FirstName`, `e`.`ReportsTo`, `e`.`Title` -FROM `Employees` AS `e` -WHERE CAST(`e`.`ReportsTo` AS bigint) = {AssertSqlHelper.Parameter("@__p_0")}", + """ + @__p_0='5' (Nullable = true) + + SELECT `e`.`EmployeeID`, `e`.`City`, `e`.`Country`, `e`.`FirstName`, `e`.`ReportsTo`, `e`.`Title` + FROM `Employees` AS `e` + WHERE IIF(`e`.`ReportsTo` IS NULL, NULL, CLNG(`e`.`ReportsTo`)) = @__p_0 + """, // - $@"SELECT `e`.`EmployeeID`, `e`.`City`, `e`.`Country`, `e`.`FirstName`, `e`.`ReportsTo`, `e`.`Title` -FROM `Employees` AS `e` -WHERE `e`.`ReportsTo` IS NULL"); + """ + SELECT `e`.`EmployeeID`, `e`.`City`, `e`.`Country`, `e`.`FirstName`, `e`.`ReportsTo`, `e`.`Title` + FROM `Employees` AS `e` + WHERE `e`.`ReportsTo` IS NULL + """); } public override async Task Where_simple_closure_via_query_cache_nullable_type_reverse(bool isAsync) @@ -363,21 +429,27 @@ WHERE `e`.`ReportsTo` IS NULL"); await base.Where_simple_closure_via_query_cache_nullable_type_reverse(isAsync); AssertSql( - $@"SELECT `e`.`EmployeeID`, `e`.`City`, `e`.`Country`, `e`.`FirstName`, `e`.`ReportsTo`, `e`.`Title` -FROM `Employees` AS `e` -WHERE `e`.`ReportsTo` IS NULL", + """ + SELECT `e`.`EmployeeID`, `e`.`City`, `e`.`Country`, `e`.`FirstName`, `e`.`ReportsTo`, `e`.`Title` + FROM `Employees` AS `e` + WHERE `e`.`ReportsTo` IS NULL + """, // - $@"{AssertSqlHelper.Declaration("@__p_0='5' (Nullable = true)")} - -SELECT `e`.`EmployeeID`, `e`.`City`, `e`.`Country`, `e`.`FirstName`, `e`.`ReportsTo`, `e`.`Title` -FROM `Employees` AS `e` -WHERE CAST(`e`.`ReportsTo` AS bigint) = {AssertSqlHelper.Parameter("@__p_0")}", + """ + @__p_0='5' (Nullable = true) + + SELECT `e`.`EmployeeID`, `e`.`City`, `e`.`Country`, `e`.`FirstName`, `e`.`ReportsTo`, `e`.`Title` + FROM `Employees` AS `e` + WHERE IIF(`e`.`ReportsTo` IS NULL, NULL, CLNG(`e`.`ReportsTo`)) = @__p_0 + """, // - $@"{AssertSqlHelper.Declaration("@__p_0='2' (Nullable = true)")} - -SELECT `e`.`EmployeeID`, `e`.`City`, `e`.`Country`, `e`.`FirstName`, `e`.`ReportsTo`, `e`.`Title` -FROM `Employees` AS `e` -WHERE CAST(`e`.`ReportsTo` AS bigint) = {AssertSqlHelper.Parameter("@__p_0")}"); + """ + @__p_0='2' (Nullable = true) + + SELECT `e`.`EmployeeID`, `e`.`City`, `e`.`Country`, `e`.`FirstName`, `e`.`ReportsTo`, `e`.`Title` + FROM `Employees` AS `e` + WHERE IIF(`e`.`ReportsTo` IS NULL, NULL, CLNG(`e`.`ReportsTo`)) = @__p_0 + """); } public override async Task Where_subquery_closure_via_query_cache(bool isAsync) @@ -880,7 +952,7 @@ FROM `Customers` AS `c`"); { await base.Where_constant_is_null(isAsync); - AssertSql( + 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"); @@ -996,14 +1068,44 @@ WHERE `c`.`City` = 'London' AND `c`.`Country` = 'UK' AND `e`.`City` = 'London' A await base.Where_primitive(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__p_0='9'")} + """ + SELECT `t`.`EmployeeID` + FROM ( + SELECT TOP 9 `e`.`EmployeeID` + FROM `Employees` AS `e` + ) AS `t` + WHERE `t`.`EmployeeID` = 5 + """); + } -SELECT `t`.`EmployeeID` -FROM ( - SELECT TOP {AssertSqlHelper.Parameter("@__p_0")} `e`.`EmployeeID` - FROM `Employees` AS `e` -) AS `t` -WHERE `t`.`EmployeeID` = 5"); + public override async Task Where_primitive_tracked(bool isAsync) + { + await base.Where_primitive_tracked(isAsync); + + AssertSql( + """ + SELECT `t`.`EmployeeID`, `t`.`City`, `t`.`Country`, `t`.`FirstName`, `t`.`ReportsTo`, `t`.`Title` + FROM ( + SELECT TOP 9 `e`.`EmployeeID`, `e`.`City`, `e`.`Country`, `e`.`FirstName`, `e`.`ReportsTo`, `e`.`Title` + FROM `Employees` AS `e` + ) AS `t` + WHERE `t`.`EmployeeID` = 5 + """); + } + + public override async Task Where_primitive_tracked2(bool isAsync) + { + await base.Where_primitive_tracked2(isAsync); + + AssertSql( + """ + SELECT `t`.`EmployeeID`, `t`.`City`, `t`.`Country`, `t`.`FirstName`, `t`.`ReportsTo`, `t`.`Title` + FROM ( + SELECT TOP 9 `e`.`EmployeeID`, `e`.`City`, `e`.`Country`, `e`.`FirstName`, `e`.`ReportsTo`, `e`.`Title` + FROM `Employees` AS `e` + ) AS `t` + WHERE `t`.`EmployeeID` = 5 + """); } public override async Task Where_bool_member(bool isAsync) @@ -1124,11 +1226,13 @@ WHERE `p`.`Discontinued` <> IIF(`p`.`ProductID` > 50, TRUE, FALSE) await base.Where_bool_parameter(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__prm_0='True'")} - -SELECT `p`.`ProductID`, `p`.`Discontinued`, `p`.`ProductName`, `p`.`SupplierID`, `p`.`UnitPrice`, `p`.`UnitsInStock` -FROM `Products` AS `p` -WHERE {AssertSqlHelper.Parameter("@__prm_0")} = True"); + """ + @__prm_0='True' + + SELECT `p`.`ProductID`, `p`.`Discontinued`, `p`.`ProductName`, `p`.`SupplierID`, `p`.`UnitPrice`, `p`.`UnitsInStock` + FROM `Products` AS `p` + WHERE @__prm_0 = TRUE + """); } public override async Task Where_bool_parameter_compared_to_binary_expression(bool isAsync) @@ -1136,11 +1240,13 @@ WHERE {AssertSqlHelper.Parameter("@__prm_0")} = True"); await base.Where_bool_parameter_compared_to_binary_expression(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__prm_0='True'")} - -SELECT `p`.`ProductID`, `p`.`Discontinued`, `p`.`ProductName`, `p`.`SupplierID`, `p`.`UnitPrice`, `p`.`UnitsInStock` -FROM `Products` AS `p` -WHERE IIF(`p`.`ProductID` > 50, 1, 0) <> {AssertSqlHelper.Parameter("@__prm_0")}"); + """ + @__prm_0='True' + + SELECT `p`.`ProductID`, `p`.`Discontinued`, `p`.`ProductName`, `p`.`SupplierID`, `p`.`UnitPrice`, `p`.`UnitsInStock` + FROM `Products` AS `p` + WHERE IIF(`p`.`ProductID` > 50, TRUE, FALSE) <> @__prm_0 + """); } public override async Task Where_bool_member_and_parameter_compared_to_binary_expression_nested(bool isAsync) @@ -1148,14 +1254,13 @@ WHERE IIF(`p`.`ProductID` > 50, 1, 0) <> {AssertSqlHelper.Parameter("@__prm_0")} await base.Where_bool_member_and_parameter_compared_to_binary_expression_nested(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__prm_0='True'")} - -SELECT `p`.`ProductID`, `p`.`Discontinued`, `p`.`ProductName`, `p`.`SupplierID`, `p`.`UnitPrice`, `p`.`UnitsInStock` -FROM `Products` AS `p` -WHERE `p`.`Discontinued` = CASE - WHEN IIF(`p`.`ProductID` > 50, 1, 0) <> {AssertSqlHelper.Parameter("@__prm_0")} THEN True - ELSE False -END"); + """ + @__prm_0='True' + + SELECT `p`.`ProductID`, `p`.`Discontinued`, `p`.`ProductName`, `p`.`SupplierID`, `p`.`UnitPrice`, `p`.`UnitsInStock` + FROM `Products` AS `p` + WHERE `p`.`Discontinued` = IIF(IIF(`p`.`ProductID` > 50, TRUE, FALSE) <> @__prm_0, TRUE, FALSE) + """); } public override async Task Where_de_morgan_or_optimized(bool isAsync) @@ -1263,11 +1368,13 @@ WHERE `c`.`CustomerID` = 'ALFKI'"); await base.Where_concat_string_int_comparison1(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__i_0='10'")} - -SELECT `c`.`CustomerID` -FROM `Customers` AS `c` -WHERE (`c`.`CustomerID` + CAST({AssertSqlHelper.Parameter("@__i_0")} AS nchar(5))) = `c`.`CompanyName`"); + """ + @__i_0='10' + + SELECT `c`.`CustomerID` + FROM `Customers` AS `c` + WHERE (`c`.`CustomerID` & (@__i_0 & '')) = `c`.`CompanyName` + """); } public override async Task Where_concat_string_int_comparison2(bool isAsync) @@ -1275,11 +1382,13 @@ WHERE (`c`.`CustomerID` + CAST({AssertSqlHelper.Parameter("@__i_0")} AS nchar(5) await base.Where_concat_string_int_comparison2(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__i_0='10'")} - -SELECT `c`.`CustomerID` -FROM `Customers` AS `c` -WHERE (CAST({AssertSqlHelper.Parameter("@__i_0")} AS nchar(5)) + `c`.`CustomerID`) = `c`.`CompanyName`"); + """ + @__i_0='10' + + SELECT `c`.`CustomerID` + FROM `Customers` AS `c` + WHERE ((@__i_0 & '') & `c`.`CustomerID`) = `c`.`CompanyName` + """); } public override async Task Where_concat_string_int_comparison3(bool isAsync) @@ -1287,13 +1396,14 @@ WHERE (CAST({AssertSqlHelper.Parameter("@__i_0")} AS nchar(5)) + `c`.`CustomerID await base.Where_concat_string_int_comparison3(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__p_0='30'")} - -{AssertSqlHelper.Declaration("@__j_1='21'")} - -SELECT `c`.`CustomerID` -FROM `Customers` AS `c` -WHERE (((CAST({AssertSqlHelper.Parameter("@__p_0")} AS nchar(5)) + `c`.`CustomerID`) + CAST({AssertSqlHelper.Parameter("@__j_1")} AS nchar(5))) + CAST(42 AS nchar(5))) = `c`.`CompanyName`"); + """ + @__p_0='30' + @__j_1='21' + + SELECT `c`.`CustomerID` + FROM `Customers` AS `c` + WHERE ((((@__p_0 & '') & `c`.`CustomerID`) & (@__j_1 & '')) & (42 & '')) = `c`.`CompanyName` + """); } public override async Task Where_concat_string_int_comparison4(bool isAsync) @@ -1313,11 +1423,13 @@ WHERE ((`o`.`OrderID` & '') & IIF(`o`.`CustomerID` IS NULL, '', `o`.`CustomerID` await base.Where_concat_string_string_comparison(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__i_0='A' (Size = 5)")} - -SELECT `c`.`CustomerID` -FROM `Customers` AS `c` -WHERE ({AssertSqlHelper.Parameter("@__i_0")} + `c`.`CustomerID`) = `c`.`CompanyName`"); + """ + @__i_0='A' (Size = 5) + + SELECT `c`.`CustomerID` + FROM `Customers` AS `c` + WHERE (@__i_0 & `c`.`CustomerID`) = `c`.`CompanyName` + """); } public override async Task Where_string_concat_method_comparison(bool isAsync) @@ -1325,11 +1437,13 @@ WHERE ({AssertSqlHelper.Parameter("@__i_0")} + `c`.`CustomerID`) = `c`.`CompanyN await base.Where_string_concat_method_comparison(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__i_0='A' (Size = 5)")} - -SELECT `c`.`CustomerID` -FROM `Customers` AS `c` -WHERE ({AssertSqlHelper.Parameter("@__i_0")} + `c`.`CustomerID`) = `c`.`CompanyName`"); + """ + @__i_0='A' (Size = 5) + + SELECT `c`.`CustomerID` + FROM `Customers` AS `c` + WHERE (@__i_0 & `c`.`CustomerID`) = `c`.`CompanyName` + """); } public override async Task Where_ternary_boolean_condition_true(bool isAsync) @@ -1357,13 +1471,13 @@ WHERE `p`.`UnitsInStock` < 20"); await base.Where_ternary_boolean_condition_with_another_condition(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__productId_0='15'")} - -@__flag_1='True' - -SELECT `p`.`ProductID`, `p`.`Discontinued`, `p`.`ProductName`, `p`.`SupplierID`, `p`.`UnitPrice`, `p`.`UnitsInStock` -FROM `Products` AS `p` -WHERE (`p`.`ProductID` < @__productId_0) AND (((@__flag_1 = True) AND (`p`.`UnitsInStock` >= 20)) OR ((@__flag_1 <> True) AND (`p`.`UnitsInStock` < 20)))"); + """ + @__productId_0='15' + + SELECT `p`.`ProductID`, `p`.`Discontinued`, `p`.`ProductName`, `p`.`SupplierID`, `p`.`UnitPrice`, `p`.`UnitsInStock` + FROM `Products` AS `p` + WHERE `p`.`ProductID` < @__productId_0 AND `p`.`UnitsInStock` >= 20 + """); } public override async Task Where_ternary_boolean_condition_with_false_as_result_true(bool isAsync) @@ -1394,7 +1508,7 @@ WHERE 0 = 1"); $@"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`"); } - + public override async Task Where_compare_constructed_multi_value_equal(bool isAsync) { await base.Where_compare_constructed_multi_value_equal(isAsync); @@ -1511,7 +1625,7 @@ FROM ( LEFT JOIN `Orders` AS `o` ON `t`.`CustomerID` = `o`.`CustomerID` ORDER BY `t`.`CustomerID` """, - // +// """ SELECT `o`.`OrderID`, `o`.`ProductID`, `o`.`Discount`, `o`.`Quantity`, `o`.`UnitPrice` FROM `Order Details` AS `o` @@ -1705,7 +1819,7 @@ WHERE `o`.`OrderID` = 1"); FROM `Customers` AS `c` WHERE `c`.`City` = 'Seattle'"); } - + public override async Task Filter_non_nullable_value_after_FirstOrDefault_on_empty_collection(bool isAsync) { await base.Filter_non_nullable_value_after_FirstOrDefault_on_empty_collection(isAsync); @@ -1746,10 +1860,14 @@ WHERE (`o`.`OrderID` & '') LIKE '%20%'"); await base.Using_same_parameter_twice_in_query_generates_one_sql_parameter(async); AssertSql( - @"@__i_0='10' -SELECT `c`.`CustomerID` -FROM `Customers` AS `c` -WHERE ((CAST(@__i_0 AS nchar(5)) + `c`.`CustomerID`) + CAST(@__i_0 AS nchar(5))) = `c`.`CompanyName`"); + """ + @__i_0='10' + @__i_0='10' + + SELECT `c`.`CustomerID` + FROM `Customers` AS `c` + WHERE (((@__i_0 & '') & `c`.`CustomerID`) & (@__i_0 & '')) = `c`.`CompanyName` + """); } public override async Task Where_Queryable_ToList_Count(bool async) @@ -1907,18 +2025,18 @@ ORDER BY `o`.`OrderID`, `o1`.`OrderID`"); await base.Where_collection_navigation_ToList_Contains(async); AssertSql( - @"@__entity_equality_order_0_OrderID='10248' (Nullable = true) -SELECT `c`.`CustomerID`, `t`.`OrderID`, `t`.`CustomerID`, `t`.`EmployeeID`, `t`.`OrderDate` -FROM `Customers` AS `c` -LEFT JOIN ( - SELECT `o0`.`OrderID`, `o0`.`CustomerID`, `o0`.`EmployeeID`, `o0`.`OrderDate` - FROM `Orders` AS `o0` -) AS `t` ON `c`.`CustomerID` = `t`.`CustomerID` -WHERE EXISTS ( - SELECT 1 - FROM `Orders` AS `o` - WHERE (`c`.`CustomerID` = `o`.`CustomerID`) AND (`o`.`OrderID` = @__entity_equality_order_0_OrderID)) -ORDER BY `c`.`CustomerID`, `t`.`OrderID`"); + """ + @__entity_equality_order_0_OrderID='10248' (Nullable = true) + + SELECT `c`.`CustomerID`, `o0`.`OrderID`, `o0`.`CustomerID`, `o0`.`EmployeeID`, `o0`.`OrderDate` + FROM `Customers` AS `c` + LEFT JOIN `Orders` AS `o0` ON `c`.`CustomerID` = `o0`.`CustomerID` + WHERE EXISTS ( + SELECT 1 + FROM `Orders` AS `o` + WHERE `c`.`CustomerID` = `o`.`CustomerID` AND `o`.`OrderID` = @__entity_equality_order_0_OrderID) + ORDER BY `c`.`CustomerID`, `o0`.`OrderID` + """); } public override async Task Where_collection_navigation_ToArray_Count(bool async) @@ -1941,18 +2059,18 @@ ORDER BY `o`.`OrderID`, `o1`.`OrderID`"); await base.Where_collection_navigation_ToArray_Contains(async); AssertSql( - @"@__entity_equality_order_0_OrderID='10248' (Nullable = true) -SELECT `c`.`CustomerID`, `t`.`OrderID`, `t`.`CustomerID`, `t`.`EmployeeID`, `t`.`OrderDate` -FROM `Customers` AS `c` -LEFT JOIN ( - SELECT `o0`.`OrderID`, `o0`.`CustomerID`, `o0`.`EmployeeID`, `o0`.`OrderDate` - FROM `Orders` AS `o0` -) AS `t` ON `c`.`CustomerID` = `t`.`CustomerID` -WHERE EXISTS ( - SELECT 1 - FROM `Orders` AS `o` - WHERE (`c`.`CustomerID` = `o`.`CustomerID`) AND (`o`.`OrderID` = @__entity_equality_order_0_OrderID)) -ORDER BY `c`.`CustomerID`, `t`.`OrderID`"); + """ + @__entity_equality_order_0_OrderID='10248' (Nullable = true) + + SELECT `c`.`CustomerID`, `o0`.`OrderID`, `o0`.`CustomerID`, `o0`.`EmployeeID`, `o0`.`OrderDate` + FROM `Customers` AS `c` + LEFT JOIN `Orders` AS `o0` ON `c`.`CustomerID` = `o0`.`CustomerID` + WHERE EXISTS ( + SELECT 1 + FROM `Orders` AS `o` + WHERE `c`.`CustomerID` = `o`.`CustomerID` AND `o`.`OrderID` = @__entity_equality_order_0_OrderID) + ORDER BY `c`.`CustomerID`, `o0`.`OrderID` + """); } public override async Task Where_collection_navigation_AsEnumerable_Count(bool async) @@ -1975,18 +2093,18 @@ ORDER BY `o`.`OrderID`, `o1`.`OrderID`"); await base.Where_collection_navigation_AsEnumerable_Contains(async); AssertSql( - @"@__entity_equality_order_0_OrderID='10248' (Nullable = true) -SELECT `c`.`CustomerID`, `t`.`OrderID`, `t`.`CustomerID`, `t`.`EmployeeID`, `t`.`OrderDate` -FROM `Customers` AS `c` -LEFT JOIN ( - SELECT `o0`.`OrderID`, `o0`.`CustomerID`, `o0`.`EmployeeID`, `o0`.`OrderDate` - FROM `Orders` AS `o0` -) AS `t` ON `c`.`CustomerID` = `t`.`CustomerID` -WHERE EXISTS ( - SELECT 1 - FROM `Orders` AS `o` - WHERE (`c`.`CustomerID` = `o`.`CustomerID`) AND (`o`.`OrderID` = @__entity_equality_order_0_OrderID)) -ORDER BY `c`.`CustomerID`, `t`.`OrderID`"); + """ + @__entity_equality_order_0_OrderID='10248' (Nullable = true) + + SELECT `c`.`CustomerID`, `o0`.`OrderID`, `o0`.`CustomerID`, `o0`.`EmployeeID`, `o0`.`OrderDate` + FROM `Customers` AS `c` + LEFT JOIN `Orders` AS `o0` ON `c`.`CustomerID` = `o0`.`CustomerID` + WHERE EXISTS ( + SELECT 1 + FROM `Orders` AS `o` + WHERE `c`.`CustomerID` = `o`.`CustomerID` AND `o`.`OrderID` = @__entity_equality_order_0_OrderID) + ORDER BY `c`.`CustomerID`, `o0`.`OrderID` + """); } public override async Task Where_collection_navigation_ToList_Count_member(bool async) @@ -2103,14 +2221,16 @@ WHERE `c`.`CustomerID` NOT IN ('ALFKI', 'ANATR', 'ANTON')"); { await base.Multiple_AndAlso_on_same_column_converted_to_in_using_parameters(async); - // issue #21462 AssertSql( - @"@__prm1_0='ALFKI' (Size = 5) (DbType = StringFixedLength) -@__prm2_1='ANATR' (Size = 5) (DbType = StringFixedLength) -@__prm3_2='ANTON' (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` -FROM `Customers` AS `c` -WHERE ((`c`.`CustomerID` <> @__prm1_0) AND (`c`.`CustomerID` <> @__prm2_1)) AND (`c`.`CustomerID` <> @__prm3_2)"); + """ + @__prm1_0='ALFKI' (Size = 5) + @__prm2_1='ANATR' (Size = 5) + @__prm3_2='ANTON' (Size = 5) + + 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` <> @__prm1_0 AND `c`.`CustomerID` <> @__prm2_1 AND `c`.`CustomerID` <> @__prm3_2 + """); } public override async Task Array_of_parameters_Contains_OrElse_comparison_with_constant_gets_combined_to_one_in(bool async) @@ -2150,11 +2270,14 @@ WHERE `c`.`CustomerID` IN ('ALFKI', 'ANATR') OR `c`.`CustomerID` = 'ANTON'"); await base.Parameter_array_Contains_OrElse_comparison_with_parameter_with_overlap(async); AssertSql( - @"@__prm1_0='ANTON' (Size = 5) (DbType = StringFixedLength) -@__prm2_2='ALFKI' (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` -FROM `Customers` AS `c` -WHERE ((`c`.`CustomerID` = @__prm1_0) OR `c`.`CustomerID` IN (N'ALFKI', N'ANATR')) OR (`c`.`CustomerID` = @__prm2_2)"); + """ + @__prm1_0='ANTON' (Size = 5) + @__prm2_2='ALFKI' (Size = 5) + + 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` = @__prm1_0 OR `c`.`CustomerID` IN ('ALFKI', 'ANATR') OR `c`.`CustomerID` = @__prm2_2 + """); } public override async Task Two_sets_of_comparison_combine_correctly(bool async)