mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved wallfilter. support update column check.
This commit is contained in:
@@ -490,4 +490,22 @@ public class SQLBinaryOpExpr extends SQLExprImpl implements SQLReplaceable, Seri
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean conditionContainsColumn(String column) {
|
||||
if (left == null || right == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (left instanceof SQLIdentifierExpr) {
|
||||
if (((SQLIdentifierExpr) left).nameEquals(column)) {
|
||||
return true;
|
||||
}
|
||||
} else if (right instanceof SQLIdentifierExpr) {
|
||||
if (((SQLIdentifierExpr) right).nameEquals(column)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,4 +178,8 @@ public class SQLIdentifierExpr extends SQLExprImpl implements SQLName {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean nameEquals(String name) {
|
||||
return SQLUtils.nameEquals(this.name, name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,4 +199,8 @@ public class SQLPropertyExpr extends SQLExprImpl implements SQLName {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean nameEquals(String name) {
|
||||
return SQLUtils.nameEquals(this.name, name);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user