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:
@@ -25,15 +25,16 @@ public class SQLIdentifierExpr extends SQLExprImpl implements SQLName {
|
||||
|
||||
private String name;
|
||||
|
||||
private transient String lowerName;
|
||||
|
||||
public SQLIdentifierExpr(){
|
||||
|
||||
}
|
||||
|
||||
public SQLIdentifierExpr(String name){
|
||||
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
public String getSimleName() {
|
||||
return name;
|
||||
}
|
||||
@@ -44,6 +45,18 @@ public class SQLIdentifierExpr extends SQLExprImpl implements SQLName {
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
this.lowerName = null;
|
||||
}
|
||||
|
||||
public String getLowerName() {
|
||||
if (lowerName == null && name != null) {
|
||||
lowerName = name.toLowerCase();
|
||||
}
|
||||
return lowerName;
|
||||
}
|
||||
|
||||
public void setLowerName(String lowerName) {
|
||||
this.lowerName = lowerName;
|
||||
}
|
||||
|
||||
public void output(StringBuffer buf) {
|
||||
|
||||
@@ -357,6 +357,10 @@ public class MySqlLexer extends Lexer {
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
if (ch == EOI) {
|
||||
this.token = Token.ERROR;
|
||||
return;
|
||||
}
|
||||
if (ch == '*' && charAt(pos + 1) == '/') {
|
||||
bufPos += 2;
|
||||
scanChar();
|
||||
|
||||
@@ -189,7 +189,8 @@ public class MySqlStatementParser extends SQLStatementParser {
|
||||
}
|
||||
|
||||
public SQLSelectStatement parseSelect() {
|
||||
return new SQLSelectStatement(new MySqlSelectParser(this.exprParser).select());
|
||||
MySqlSelectParser selectParser = new MySqlSelectParser(this.exprParser);
|
||||
return new SQLSelectStatement(selectParser.select());
|
||||
}
|
||||
|
||||
public SQLUpdateStatement parseUpdateStatement() {
|
||||
|
||||
Reference in New Issue
Block a user