bug fixed for SchemaStatVisitor. for issue #2306

This commit is contained in:
wenshao
2018-02-04 13:24:57 +08:00
parent 6672fc5cd9
commit 6d9c176450
3 changed files with 68 additions and 4 deletions
@@ -641,11 +641,18 @@ public class SchemaStatVisitor extends SQLASTVisitorAdapter {
if (valueColumn != null) {
continue;
}
Object value = SQLEvalVisitorUtils.eval(dbType, item, parameters, false);
if (value == SQLEvalVisitor.EVAL_VALUE_NULL) {
value = null;
Object value;
if (item instanceof SQLMethodInvokeExpr) {
value = item.toString();
} else {
value = SQLEvalVisitorUtils.eval(dbType, item, parameters, false);
if (value == SQLEvalVisitor.EVAL_VALUE_NULL) {
value = null;
}
}
condition.getValues().add(value);
condition.addValue(value);
}
}
@@ -323,6 +323,10 @@ public class TableStat {
return values;
}
public void addValue(Object value) {
this.values.add(value);
}
@Override
public int hashCode() {
final int prime = 31;