mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bugfix
This commit is contained in:
@@ -1330,8 +1330,12 @@ public class SQLEvalVisitorUtils {
|
||||
return new BigInteger(val);
|
||||
} catch (NumberFormatException e) {
|
||||
}
|
||||
|
||||
return new BigDecimal(val);
|
||||
|
||||
try {
|
||||
return new BigDecimal(val);
|
||||
} catch (NumberFormatException e) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public static Date castToDate(Object val) {
|
||||
@@ -1426,6 +1430,18 @@ public class SQLEvalVisitorUtils {
|
||||
if (a == null || b == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if(a == EVAL_VALUE_NULL || b == EVAL_VALUE_NULL) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (a instanceof String) {
|
||||
a = castToNumber((String) a);
|
||||
}
|
||||
|
||||
if (b instanceof String) {
|
||||
b = castToNumber((String) b);
|
||||
}
|
||||
|
||||
if (a instanceof Long || b instanceof Long) {
|
||||
return castToLong(a).longValue() | castToLong(b).longValue();
|
||||
@@ -1660,6 +1676,10 @@ public class SQLEvalVisitorUtils {
|
||||
if (a == null || b == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (a == EVAL_VALUE_NULL || b == EVAL_VALUE_NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (a.equals(b)) {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user