mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for mod function eval. issue #1588
This commit is contained in:
@@ -260,12 +260,16 @@ public class SQLEvalVisitorUtils {
|
||||
return false;
|
||||
}
|
||||
|
||||
int intValue0 = castToInteger(param0Value);
|
||||
int intValue1 = castToInteger(param1Value);
|
||||
long intValue0 = castToLong(param0Value);
|
||||
long intValue1 = castToLong(param1Value);
|
||||
|
||||
int result = intValue0 % intValue1;
|
||||
|
||||
x.putAttribute(EVAL_VALUE, result);
|
||||
long result = intValue0 % intValue1;
|
||||
if (result >= Integer.MIN_VALUE && result <= Integer.MAX_VALUE) {
|
||||
int intResult = (int) result;
|
||||
x.putAttribute(EVAL_VALUE, intResult);
|
||||
} else {
|
||||
x.putAttribute(EVAL_VALUE, result);
|
||||
}
|
||||
} else if ("abs".equals(methodName)) {
|
||||
if (x.getParameters().size() != 1) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user