mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improve WallFilter
This commit is contained in:
@@ -27,7 +27,6 @@ import com.alibaba.druid.sql.parser.Keywords;
|
||||
import com.alibaba.druid.sql.parser.Lexer;
|
||||
import com.alibaba.druid.sql.parser.NotAllowCommentException;
|
||||
import com.alibaba.druid.sql.parser.ParserException;
|
||||
import com.alibaba.druid.sql.parser.SQLParseException;
|
||||
import com.alibaba.druid.sql.parser.Token;
|
||||
|
||||
public class MySqlLexer extends Lexer {
|
||||
@@ -64,7 +63,7 @@ public class MySqlLexer extends Lexer {
|
||||
|
||||
public void scanVariable() {
|
||||
if (ch != '@' && ch != ':' && ch != '#' && ch != '$') {
|
||||
throw new SQLParseException("illegal variable");
|
||||
throw new ParserException("illegal variable");
|
||||
}
|
||||
|
||||
mark = pos;
|
||||
@@ -87,7 +86,7 @@ public class MySqlLexer extends Lexer {
|
||||
ch = charAt(++pos);
|
||||
break;
|
||||
} else if (ch == EOI) {
|
||||
throw new SQLParseException("illegal identifier");
|
||||
throw new ParserException("illegal identifier");
|
||||
}
|
||||
|
||||
bufPos++;
|
||||
@@ -110,7 +109,7 @@ public class MySqlLexer extends Lexer {
|
||||
ch = charAt(++pos);
|
||||
break;
|
||||
} else if (ch == EOI) {
|
||||
throw new SQLParseException("illegal identifier");
|
||||
throw new ParserException("illegal identifier");
|
||||
}
|
||||
|
||||
bufPos++;
|
||||
@@ -156,7 +155,7 @@ public class MySqlLexer extends Lexer {
|
||||
ch = charAt(++pos);
|
||||
break;
|
||||
} else if (ch == EOI) {
|
||||
throw new SQLParseException("illegal identifier");
|
||||
throw new ParserException("illegal identifier");
|
||||
}
|
||||
|
||||
bufPos++;
|
||||
@@ -176,7 +175,7 @@ public class MySqlLexer extends Lexer {
|
||||
|
||||
final boolean firstFlag = isFirstIdentifierChar(first);
|
||||
if (!firstFlag) {
|
||||
throw new SQLParseException("illegal identifier");
|
||||
throw new ParserException("illegal identifier");
|
||||
}
|
||||
|
||||
mark = pos;
|
||||
|
||||
@@ -138,7 +138,6 @@ import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlUnlockTablesStatem
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlUpdateStatement;
|
||||
import com.alibaba.druid.sql.parser.Lexer;
|
||||
import com.alibaba.druid.sql.parser.ParserException;
|
||||
import com.alibaba.druid.sql.parser.SQLParseException;
|
||||
import com.alibaba.druid.sql.parser.SQLSelectParser;
|
||||
import com.alibaba.druid.sql.parser.SQLStatementParser;
|
||||
import com.alibaba.druid.sql.parser.Token;
|
||||
@@ -1860,7 +1859,7 @@ public class MySqlStatementParser extends SQLStatementParser {
|
||||
private void parseValueClause(List<ValuesClause> valueClauseList, int columnSize) {
|
||||
for (;;) {
|
||||
if (lexer.token() != Token.LPAREN) {
|
||||
throw new SQLParseException("syntax error, expect ')'");
|
||||
throw new ParserException("syntax error, expect ')'");
|
||||
}
|
||||
lexer.nextTokenValue();
|
||||
|
||||
@@ -1914,7 +1913,7 @@ public class MySqlStatementParser extends SQLStatementParser {
|
||||
}
|
||||
|
||||
if (lexer.token() != Token.RPAREN) {
|
||||
throw new SQLParseException("syntax error");
|
||||
throw new ParserException("syntax error");
|
||||
}
|
||||
|
||||
lexer.nextTokenComma();
|
||||
|
||||
Reference in New Issue
Block a user