mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
WallFilter improve multi-tenant support
This commit is contained in:
@@ -942,19 +942,25 @@ public class SQLASTOutputVisitor extends SQLASTVisitorAdapter {
|
||||
@Override
|
||||
public boolean visit(SQLJoinTableSource x) {
|
||||
x.getLeft().accept(this);
|
||||
incrementIndent();
|
||||
|
||||
if (x.getJoinType() == JoinType.COMMA) {
|
||||
print(",");
|
||||
} else {
|
||||
print(" ");
|
||||
println();
|
||||
print(JoinType.toString(x.getJoinType()));
|
||||
}
|
||||
print(" ");
|
||||
x.getRight().accept(this);
|
||||
|
||||
if (x.getCondition() != null) {
|
||||
incrementIndent();
|
||||
print(" ON ");
|
||||
x.getCondition().accept(this);
|
||||
decrementIndent();
|
||||
}
|
||||
|
||||
decrementIndent();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -28,6 +28,8 @@ public interface WallVisitor extends SQLASTVisitor {
|
||||
|
||||
List<Violation> getViolations();
|
||||
|
||||
void addViolation(Violation violation);
|
||||
|
||||
boolean isPermitTable(String name);
|
||||
|
||||
String toSQL(SQLObject obj);
|
||||
|
||||
@@ -71,6 +71,10 @@ public class MySqlWallVisitor extends MySqlASTVisitorAdapter implements WallVisi
|
||||
public WallConfig getConfig() {
|
||||
return config;
|
||||
}
|
||||
|
||||
public void addViolation(Violation violation) {
|
||||
this.violations.add(violation);
|
||||
}
|
||||
|
||||
public List<Violation> getViolations() {
|
||||
return violations;
|
||||
|
||||
@@ -71,6 +71,10 @@ public class OracleWallVisitor extends OracleASTVisitorAdapter implements WallVi
|
||||
return config;
|
||||
}
|
||||
|
||||
public void addViolation(Violation violation) {
|
||||
this.violations.add(violation);
|
||||
}
|
||||
|
||||
public List<Violation> getViolations() {
|
||||
return violations;
|
||||
}
|
||||
|
||||
@@ -68,6 +68,10 @@ public class SQLServerWallVisitor extends SQLServerASTVisitorAdapter implements
|
||||
return this.config;
|
||||
}
|
||||
|
||||
public void addViolation(Violation violation) {
|
||||
this.violations.add(violation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Violation> getViolations() {
|
||||
return violations;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user