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:
@@ -114,6 +114,8 @@ public class Keywords {
|
||||
map.put("OVER", Token.OVER);
|
||||
map.put("TO", Token.TO);
|
||||
map.put("USE", Token.USE);
|
||||
|
||||
map.put("REPLACE", Token.REPLACE);
|
||||
|
||||
DEFAULT_KEYWORDS = new Keywords(map);
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ public class SQLStatementParser extends SQLParser {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (identifierEquals("SHOW")) {
|
||||
if (lexer.token() == Token.SHOW) {
|
||||
SQLStatement stmt = parseShow();
|
||||
|
||||
statementList.add(stmt);
|
||||
@@ -489,7 +489,7 @@ public class SQLStatementParser extends SQLParser {
|
||||
return parseCreateSequence(false);
|
||||
} else if (token == Token.OR) {
|
||||
lexer.nextToken();
|
||||
acceptIdentifier("REPLACE");
|
||||
accept(Token.REPLACE);
|
||||
if (lexer.token() == Token.PROCEDURE) {
|
||||
lexer.reset(markBp, markChar, Token.CREATE);
|
||||
return parseCreateProcedure();
|
||||
@@ -651,7 +651,7 @@ public class SQLStatementParser extends SQLParser {
|
||||
|
||||
if (lexer.token() == Token.OR) {
|
||||
lexer.nextToken();
|
||||
acceptIdentifier("REPLACE");
|
||||
accept(Token.REPLACE);
|
||||
createView.setOrReplace(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -107,6 +107,8 @@ public enum Token {
|
||||
PASSWORD("PASSWORD"),
|
||||
DUAL("DUAL"),
|
||||
BINARY("BINARY"),
|
||||
SHOW("SHOW"),
|
||||
REPLACE("REPLACE"),
|
||||
|
||||
//postgresql
|
||||
WINDOW("WINDOW"),
|
||||
|
||||
Reference in New Issue
Block a user