add list judge

This commit is contained in:
kiki
2013-06-07 18:46:17 +08:00
parent f7ca97224a
commit 4b2724d118
@@ -797,6 +797,9 @@ public class SQLEvalVisitorUtils {
wallConditionContext.setConstArithmetic(true);
}
leftValue = processValue(leftValue);
rightValue = processValue(rightValue);
if (leftValue == null || rightValue == null) {
return false;
}
@@ -890,6 +893,17 @@ public class SQLEvalVisitorUtils {
return false;
}
@SuppressWarnings("rawtypes")
private static Object processValue(Object value) {
if (value instanceof List) {
List list = (List) value;
if (list.size() == 1) {
return processValue(list.get(0));
}
}
return value;
}
private static boolean isAlwayTrueLikePattern(SQLExpr x) {
if (x instanceof SQLCharExpr) {
String text = ((SQLCharExpr) x).getText();