This commit is contained in:
yakolee
2014-06-05 19:36:52 +08:00
parent b5daf4a8f5
commit d20b1f684e
@@ -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;