Skip to content

Commit 74a00fe

Browse files
committed
[fix][runtime] Fixed the incorrect result when the abs function takes a value of -2^31 or -2^63
1 parent bee98ed commit 74a00fe

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

runtime/src/main/java/io/dingodb/expr/runtime/op/mathematical/AbsCheckFun.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ abstract class AbsCheckFun extends UnaryNumericOp {
3030

3131
private static final long serialVersionUID = 6834907753646404442L;
3232

33-
static int abs(int num) {
33+
static Object abs(int num) {
3434
if (num == Integer.MIN_VALUE) {
35-
throw new ExprEvaluatingException(ExceptionUtils.exceedsIntRange());
35+
return Math.abs(Long.parseLong(String.valueOf(num)));
36+
//throw new ExprEvaluatingException(ExceptionUtils.exceedsIntRange());
3637
}
3738
return Math.abs(num);
3839
}

0 commit comments

Comments
 (0)