mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improve wall filter
This commit is contained in:
@@ -28,7 +28,9 @@ public class SQLPropertyExpr extends SQLExprImpl implements SQLName {
|
||||
private String name;
|
||||
|
||||
public SQLPropertyExpr(SQLExpr owner, String name){
|
||||
|
||||
if (owner != null) {
|
||||
owner.setParent(this);
|
||||
}
|
||||
this.owner = owner;
|
||||
this.name = name;
|
||||
}
|
||||
@@ -46,6 +48,9 @@ public class SQLPropertyExpr extends SQLExprImpl implements SQLName {
|
||||
}
|
||||
|
||||
public void setOwner(SQLExpr owner) {
|
||||
if (owner != null) {
|
||||
owner.setParent(this);
|
||||
}
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,8 @@ import java.util.List;
|
||||
|
||||
import com.alibaba.druid.sql.ast.SQLName;
|
||||
import com.alibaba.druid.sql.ast.SQLStatementImpl;
|
||||
import com.alibaba.druid.sql.dialect.mysql.visitor.MySqlASTVisitor;
|
||||
import com.alibaba.druid.sql.visitor.SQLASTVisitor;
|
||||
|
||||
public class SQLAlterTableStatement extends SQLStatementImpl implements SQLDDLStatement {
|
||||
|
||||
@@ -54,4 +56,13 @@ public class SQLAlterTableStatement extends SQLStatementImpl implements SQLDDLSt
|
||||
public void setName(SQLName name) {
|
||||
this.setTableSource(new SQLExprTableSource(name));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void accept0(SQLASTVisitor visitor) {
|
||||
if (visitor.visit(this)) {
|
||||
acceptChild(visitor, getTableSource());
|
||||
acceptChild(visitor, getItems());
|
||||
}
|
||||
visitor.endVisit(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,6 +44,9 @@ public class SQLDeleteStatement extends SQLStatementImpl {
|
||||
}
|
||||
|
||||
public void setTableSource(SQLTableSource tableSource) {
|
||||
if (tableSource != null) {
|
||||
tableSource.setParent(this);
|
||||
}
|
||||
this.tableSource = tableSource;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,6 +49,9 @@ public abstract class SQLInsertInto extends SQLObjectImpl {
|
||||
}
|
||||
|
||||
public void setTableSource(SQLExprTableSource tableSource) {
|
||||
if (tableSource != null) {
|
||||
tableSource.setParent(this);
|
||||
}
|
||||
this.tableSource = tableSource;
|
||||
}
|
||||
|
||||
|
||||
@@ -63,6 +63,9 @@ public class SQLJoinTableSource extends SQLTableSourceImpl {
|
||||
}
|
||||
|
||||
public void setLeft(SQLTableSource left) {
|
||||
if (left != null) {
|
||||
left.setParent(this);
|
||||
}
|
||||
this.left = left;
|
||||
}
|
||||
|
||||
@@ -71,6 +74,9 @@ public class SQLJoinTableSource extends SQLTableSourceImpl {
|
||||
}
|
||||
|
||||
public void setRight(SQLTableSource right) {
|
||||
if (right != null) {
|
||||
right.setParent(this);
|
||||
}
|
||||
this.right = right;
|
||||
}
|
||||
|
||||
@@ -79,6 +85,9 @@ public class SQLJoinTableSource extends SQLTableSourceImpl {
|
||||
}
|
||||
|
||||
public void setCondition(SQLExpr condition) {
|
||||
if (condition != null) {
|
||||
condition.setParent(this);
|
||||
}
|
||||
this.condition = condition;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,10 +43,13 @@ public class SQLSelectQueryBlock extends SQLSelectQuery {
|
||||
}
|
||||
|
||||
public void setInto(SQLExpr into) {
|
||||
this.into = new SQLExprTableSource(into);
|
||||
this.setInto(new SQLExprTableSource(into));
|
||||
}
|
||||
|
||||
public void setInto(SQLExprTableSource into) {
|
||||
if (into != null) {
|
||||
into.setParent(this);
|
||||
}
|
||||
this.into = into;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,9 @@ public class SQLTruncateStatement extends SQLStatementImpl {
|
||||
}
|
||||
|
||||
public void addTableSource(SQLName name) {
|
||||
this.tableSources.add(new SQLExprTableSource(name));
|
||||
SQLExprTableSource tableSource = new SQLExprTableSource(name);
|
||||
tableSource.setParent(this);
|
||||
this.tableSources.add(tableSource);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -45,6 +45,9 @@ public class SQLUpdateStatement extends SQLStatementImpl {
|
||||
}
|
||||
|
||||
public void setTableSource(SQLTableSource tableSource) {
|
||||
if (tableSource != null) {
|
||||
tableSource.setParent(this);
|
||||
}
|
||||
this.tableSource = tableSource;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user