Skip to content

Commit a7d9f84

Browse files
authored
Change Where_math(f)_log_new_base queries, so they fail if LOG() parameters are swapped. (#33342)
1 parent 7a41bd2 commit a7d9f84

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

test/EFCore.Cosmos.FunctionalTests/Query/NorthwindFunctionsQueryCosmosTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ public override async Task Where_mathf_log_new_base(bool async)
763763
"""
764764
SELECT c
765765
FROM root c
766-
WHERE (((c["Discriminator"] = "OrderDetail") AND ((c["OrderID"] = 11077) AND (c["Discount"] > 0.0))) AND (LOG(c["Discount"], 7.0) < 0.0))
766+
WHERE (((c["Discriminator"] = "OrderDetail") AND ((c["OrderID"] = 11077) AND (c["Discount"] > 0.0))) AND (LOG(c["Discount"], 7.0) < -1.0))
767767
""");
768768
}
769769

test/EFCore.Specification.Tests/Query/NorthwindFunctionsQueryTestBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ public virtual Task Where_math_log(bool async)
955955
public virtual Task Where_math_log_new_base(bool async)
956956
=> AssertQuery(
957957
async,
958-
ss => ss.Set<OrderDetail>().Where(od => od.OrderID == 11077 && od.Discount > 0).Where(od => Math.Log(od.Discount, 7) < 0));
958+
ss => ss.Set<OrderDetail>().Where(od => od.OrderID == 11077 && od.Discount > 0).Where(od => Math.Log(od.Discount, 7) < -1));
959959

960960
[ConditionalTheory]
961961
[MemberData(nameof(IsAsyncData))]
@@ -1190,7 +1190,7 @@ public virtual Task Where_mathf_log(bool async)
11901190
public virtual Task Where_mathf_log_new_base(bool async)
11911191
=> AssertQuery(
11921192
async,
1193-
ss => ss.Set<OrderDetail>().Where(od => od.OrderID == 11077 && od.Discount > 0).Where(od => MathF.Log(od.Discount, 7) < 0));
1193+
ss => ss.Set<OrderDetail>().Where(od => od.OrderID == 11077 && od.Discount > 0).Where(od => MathF.Log(od.Discount, 7) < -1));
11941194

11951195
[ConditionalTheory]
11961196
[MemberData(nameof(IsAsyncData))]

test/EFCore.SqlServer.FunctionalTests/Query/NorthwindFunctionsQuerySqlServerTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,7 +1220,7 @@ public override async Task Where_math_log_new_base(bool async)
12201220
"""
12211221
SELECT [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[Quantity], [o].[UnitPrice]
12221222
FROM [Order Details] AS [o]
1223-
WHERE [o].[OrderID] = 11077 AND [o].[Discount] > CAST(0 AS real) AND LOG(CAST([o].[Discount] AS float), 7.0E0) < 0.0E0
1223+
WHERE [o].[OrderID] = 11077 AND [o].[Discount] > CAST(0 AS real) AND LOG(CAST([o].[Discount] AS float), 7.0E0) < -1.0E0
12241224
""");
12251225
}
12261226

@@ -1598,7 +1598,7 @@ public override async Task Where_mathf_log_new_base(bool async)
15981598
"""
15991599
SELECT [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[Quantity], [o].[UnitPrice]
16001600
FROM [Order Details] AS [o]
1601-
WHERE [o].[OrderID] = 11077 AND [o].[Discount] > CAST(0 AS real) AND LOG([o].[Discount], CAST(7 AS real)) < CAST(0 AS real)
1601+
WHERE [o].[OrderID] = 11077 AND [o].[Discount] > CAST(0 AS real) AND LOG([o].[Discount], CAST(7 AS real)) < CAST(-1 AS real)
16021602
""");
16031603
}
16041604

test/EFCore.Sqlite.FunctionalTests/Query/NorthwindFunctionsQuerySqliteTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ public override async Task Where_math_log_new_base(bool async)
275275
"""
276276
SELECT "o"."OrderID", "o"."ProductID", "o"."Discount", "o"."Quantity", "o"."UnitPrice"
277277
FROM "Order Details" AS "o"
278-
WHERE "o"."OrderID" = 11077 AND "o"."Discount" > 0 AND log(7.0, CAST("o"."Discount" AS REAL)) < 0.0
278+
WHERE "o"."OrderID" = 11077 AND "o"."Discount" > 0 AND log(7.0, CAST("o"."Discount" AS REAL)) < -1.0
279279
""");
280280
}
281281

@@ -572,7 +572,7 @@ public override async Task Where_mathf_log_new_base(bool async)
572572
"""
573573
SELECT "o"."OrderID", "o"."ProductID", "o"."Discount", "o"."Quantity", "o"."UnitPrice"
574574
FROM "Order Details" AS "o"
575-
WHERE "o"."OrderID" = 11077 AND "o"."Discount" > 0 AND log(7, "o"."Discount") < 0
575+
WHERE "o"."OrderID" = 11077 AND "o"."Discount" > 0 AND log(7, "o"."Discount") < -1
576576
""");
577577
}
578578

0 commit comments

Comments
 (0)