improve wall filter

This commit is contained in:
wenshao
2013-04-11 15:38:13 +08:00
parent 7d80ffd7a7
commit eddb42ae53
28 changed files with 946 additions and 69 deletions
@@ -60,6 +60,9 @@ public class SQLInSubQueryExpr extends SQLExprImpl implements Serializable {
}
public void setSubQuery(SQLSelect subQuery) {
if (subQuery != null) {
subQuery.setParent(this);
}
this.subQuery = subQuery;
}
@@ -28,10 +28,7 @@ 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;
setOwner(owner);
this.name = name;
}
@@ -53,7 +50,7 @@ public class SQLPropertyExpr extends SQLExprImpl implements SQLName {
}
this.owner = owner;
}
public String getName() {
return this.name;
}
@@ -363,7 +363,7 @@ public class MySqlLexer extends Lexer {
return;
}
if (ch == '*' && charAt(pos + 1) == '/') {
bufPos += 2;
bufPos += 3;
scanChar();
scanChar();
break;
@@ -393,11 +393,6 @@ public class MySqlLexer extends Lexer {
return;
}
if (!isAllowComment()) {
throw new NotAllowCommentException();
}
if (ch == '/' || ch == '-') {
scanChar();
bufPos++;
@@ -425,8 +420,17 @@ public class MySqlLexer extends Lexer {
bufPos++;
}
stringVal = subString(mark + 1, bufPos);
stringVal = subString(mark, bufPos + 1);
token = Token.LINE_COMMENT;
if (commentHandler != null && commentHandler.handle(lastToken, stringVal)) {
return;
}
if (!isAllowComment()) {
throw new NotAllowCommentException();
}
return;
}
}