Merge pull request #362 from cutedemons/master

add list judge
This commit is contained in:
温高铁
2013-06-07 03:49:05 -07:00
@@ -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();