mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improve sql wall
This commit is contained in:
@@ -38,7 +38,10 @@ public class If implements Function {
|
||||
SQLExpr condition = parameters.get(0);
|
||||
condition.accept(visitor);
|
||||
Object itemValue = condition.getAttributes().get(EVAL_VALUE);
|
||||
if (Boolean.TRUE == itemValue || (itemValue != null && !SQLEvalVisitorUtils.eq(itemValue, 0))) {
|
||||
if (itemValue == null) {
|
||||
return null;
|
||||
}
|
||||
if (Boolean.TRUE == itemValue || !SQLEvalVisitorUtils.eq(itemValue, 0)) {
|
||||
SQLExpr trueExpr = parameters.get(1);
|
||||
trueExpr.accept(visitor);
|
||||
return trueExpr.getAttributes().get(EVAL_VALUE);
|
||||
|
||||
Reference in New Issue
Block a user