Skip to content

Commit 257de73

Browse files
Copilotrenemadsen
andcommitted
Fix Assert.Empty() failure for Correlated_collection tests - add SQL expectations for MySQL 8.0.14+
Co-authored-by: renemadsen <[email protected]>
1 parent e853ef1 commit 257de73

File tree

1 file changed

+37
-2
lines changed

1 file changed

+37
-2
lines changed

test/EFCore.MySql.FunctionalTests/Query/NorthwindMiscellaneousQueryMySqlTest.cs

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6826,14 +6826,49 @@ public override async Task Correlated_collection_with_distinct_without_default_i
68266826
{
68276827
await base.Correlated_collection_with_distinct_without_default_identifiers_projecting_columns(async);
68286828

6829-
AssertSql();
6829+
if (AppConfig.ServerVersion.Supports.OuterApply)
6830+
{
6831+
AssertSql(
6832+
"""
6833+
SELECT `c`.`CustomerID`, `o0`.`First`, `o0`.`Second`
6834+
FROM `Customers` AS `c`
6835+
LEFT JOIN LATERAL (
6836+
SELECT DISTINCT `o`.`OrderID` AS `First`, `o`.`OrderDate` AS `Second`
6837+
FROM `Orders` AS `o`
6838+
WHERE `c`.`CustomerID` = `o`.`CustomerID`
6839+
) AS `o0` ON TRUE
6840+
ORDER BY `c`.`CustomerID`
6841+
""");
6842+
}
6843+
else
6844+
{
6845+
AssertSql();
6846+
}
68306847
}
68316848

68326849
public override async Task Correlated_collection_with_distinct_without_default_identifiers_projecting_columns_with_navigation(bool async)
68336850
{
68346851
await base.Correlated_collection_with_distinct_without_default_identifiers_projecting_columns_with_navigation(async);
68356852

6836-
AssertSql();
6853+
if (AppConfig.ServerVersion.Supports.OuterApply)
6854+
{
6855+
AssertSql(
6856+
"""
6857+
SELECT `c`.`CustomerID`, `s`.`First`, `s`.`Second`, `s`.`Third`
6858+
FROM `Customers` AS `c`
6859+
LEFT JOIN LATERAL (
6860+
SELECT DISTINCT `o`.`OrderID` AS `First`, `o`.`OrderDate` AS `Second`, `c0`.`City` AS `Third`
6861+
FROM `Orders` AS `o`
6862+
LEFT JOIN `Customers` AS `c0` ON `o`.`CustomerID` = `c0`.`CustomerID`
6863+
WHERE `c`.`CustomerID` = `o`.`CustomerID`
6864+
) AS `s` ON TRUE
6865+
ORDER BY `c`.`CustomerID`, `s`.`First`, `s`.`Second`
6866+
""");
6867+
}
6868+
else
6869+
{
6870+
AssertSql();
6871+
}
68376872
}
68386873

68396874
public override async Task Select_nested_collection_with_distinct(bool async)

0 commit comments

Comments
 (0)