Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public class JetMathTranslator(ISqlExpressionFactory sqlExpressionFactory) : IMe
resultType = typeof(double);
}
var result = (SqlExpression)_sqlExpressionFactory.Function(
"INT",
"FIX",
[argument],
nullable: true,
argumentsPropagateNullability: [true],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,7 @@ public override async Task Sum_over_truncate_works_correctly_in_projection(bool
AssertSql(
"""
SELECT `o`.`OrderID`, (
SELECT IIF(SUM(INT(`o0`.`UnitPrice`)) IS NULL, 0.0, SUM(INT(`o0`.`UnitPrice`)))
SELECT IIF(SUM(FIX(`o0`.`UnitPrice`)) IS NULL, 0.0, SUM(FIX(`o0`.`UnitPrice`)))
FROM `Order Details` AS `o0`
WHERE `o`.`OrderID` = `o0`.`OrderID`) AS `Sum`
FROM `Orders` AS `o`
Expand All @@ -1183,7 +1183,7 @@ public override async Task Sum_over_truncate_works_correctly_in_projection_2(boo
AssertSql(
"""
SELECT `o`.`OrderID`, (
SELECT IIF(SUM(INT(`o0`.`UnitPrice` * `o0`.`UnitPrice`)) IS NULL, 0.0, SUM(INT(`o0`.`UnitPrice` * `o0`.`UnitPrice`)))
SELECT IIF(SUM(FIX(`o0`.`UnitPrice` * `o0`.`UnitPrice`)) IS NULL, 0.0, SUM(FIX(`o0`.`UnitPrice` * `o0`.`UnitPrice`)))
FROM `Order Details` AS `o0`
WHERE `o`.`OrderID` = `o0`.`OrderID`) AS `Sum`
FROM `Orders` AS `o`
Expand All @@ -1209,7 +1209,7 @@ public override async Task Select_math_truncate_int(bool isAsync)

AssertSql(
$"""
SELECT INT(CDBL(`o`.`OrderID`)) AS `A`
SELECT FIX(CDBL(`o`.`OrderID`)) AS `A`
FROM `Orders` AS `o`
WHERE `o`.`OrderID` < 10250
""");
Expand All @@ -1235,7 +1235,7 @@ public override async Task Where_math_truncate(bool isAsync)
$"""
SELECT `o`.`OrderID`, `o`.`ProductID`, `o`.`Discount`, `o`.`Quantity`, `o`.`UnitPrice`
FROM `Order Details` AS `o`
WHERE `o`.`Quantity` < 5 AND INT(`o`.`UnitPrice`) > 10.0
WHERE `o`.`Quantity` < 5 AND FIX(`o`.`UnitPrice`) > 10.0
""");
}

Expand Down Expand Up @@ -1597,7 +1597,7 @@ public override async Task Where_mathf_truncate(bool async)
"""
SELECT `o`.`OrderID`, `o`.`ProductID`, `o`.`Discount`, `o`.`Quantity`, `o`.`UnitPrice`
FROM `Order Details` AS `o`
WHERE `o`.`Quantity` < 5 AND IIF(INT(CSNG(`o`.`UnitPrice`)) IS NULL, NULL, CSNG(INT(CSNG(`o`.`UnitPrice`)))) > 10
WHERE `o`.`Quantity` < 5 AND IIF(FIX(CSNG(`o`.`UnitPrice`)) IS NULL, NULL, CSNG(FIX(CSNG(`o`.`UnitPrice`)))) > 10
""");
}

Expand All @@ -1607,7 +1607,7 @@ public override async Task Select_mathf_truncate(bool async)

AssertSql(
"""
SELECT IIF(INT(CSNG(`o`.`UnitPrice`)) IS NULL, NULL, CSNG(INT(CSNG(`o`.`UnitPrice`))))
SELECT IIF(FIX(CSNG(`o`.`UnitPrice`)) IS NULL, NULL, CSNG(FIX(CSNG(`o`.`UnitPrice`))))
FROM `Order Details` AS `o`
WHERE `o`.`Quantity` < 5
""");
Expand Down
Loading