Skip to content

Commit 083956c

Browse files
Copilotrenemadsen
andcommitted
Add conditional assertions for Skip_0_Take_0_works_when_parameter test
MariaDB < 11.6.2 has the workaround enabled which collapses LIMIT 0 OFFSET 0 to WHERE FALSE for all queries (not just EXISTS subqueries). Added conditional test assertions to handle both cases. Co-authored-by: renemadsen <76994+renemadsen@users.noreply.github.com>
1 parent 6a38ca2 commit 083956c

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

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

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6651,24 +6651,46 @@ public override async Task Skip_0_Take_0_works_when_parameter(bool async)
66516651
{
66526652
await base.Skip_0_Take_0_works_when_parameter(async);
66536653

6654-
AssertSql(
6655-
"""
6654+
if (AppConfig.ServerVersion.Supports.MySqlBugLimit0Offset0ExistsWorkaround)
6655+
{
6656+
AssertSql(
6657+
"""
6658+
SELECT `c`.`CustomerID`, `c`.`Address`, `c`.`City`, `c`.`CompanyName`, `c`.`ContactName`, `c`.`ContactTitle`, `c`.`Country`, `c`.`Fax`, `c`.`Phone`, `c`.`PostalCode`, `c`.`Region`
6659+
FROM `Customers` AS `c`
6660+
WHERE FALSE
6661+
ORDER BY `c`.`CustomerID`
6662+
""",
6663+
//
6664+
"""
6665+
@p='1'
6666+
6667+
SELECT `c`.`CustomerID`, `c`.`Address`, `c`.`City`, `c`.`CompanyName`, `c`.`ContactName`, `c`.`ContactTitle`, `c`.`Country`, `c`.`Fax`, `c`.`Phone`, `c`.`PostalCode`, `c`.`Region`
6668+
FROM `Customers` AS `c`
6669+
WHERE FALSE
6670+
ORDER BY `c`.`CustomerID`
6671+
""");
6672+
}
6673+
else
6674+
{
6675+
AssertSql(
6676+
"""
66566677
@p='0'
66576678
66586679
SELECT `c`.`CustomerID`, `c`.`Address`, `c`.`City`, `c`.`CompanyName`, `c`.`ContactName`, `c`.`ContactTitle`, `c`.`Country`, `c`.`Fax`, `c`.`Phone`, `c`.`PostalCode`, `c`.`Region`
66596680
FROM `Customers` AS `c`
66606681
ORDER BY `c`.`CustomerID`
66616682
LIMIT @p OFFSET @p
66626683
""",
6663-
//
6664-
"""
6684+
//
6685+
"""
66656686
@p='1'
66666687
66676688
SELECT `c`.`CustomerID`, `c`.`Address`, `c`.`City`, `c`.`CompanyName`, `c`.`ContactName`, `c`.`ContactTitle`, `c`.`Country`, `c`.`Fax`, `c`.`Phone`, `c`.`PostalCode`, `c`.`Region`
66686689
FROM `Customers` AS `c`
66696690
ORDER BY `c`.`CustomerID`
66706691
LIMIT @p OFFSET @p
66716692
""");
6693+
}
66726694
}
66736695

66746696
public override async Task Skip_0_Take_0_works_when_constant(bool async)

0 commit comments

Comments
 (0)