mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for mysql parser create function. for issue #2340
This commit is contained in:
@@ -2428,6 +2428,16 @@ public class SQLExprParser extends SQLParser {
|
||||
|
||||
accept(Token.SET);
|
||||
|
||||
if (lexer.token != Token.IDENTIFIER
|
||||
&& lexer.token != Token.LITERAL_CHARS
|
||||
&& lexer.token != Token.BINARY) {
|
||||
throw new ParserException(lexer.info());
|
||||
}
|
||||
charType.setCharSetName(lexer.stringVal());
|
||||
lexer.nextToken();
|
||||
} else if (lexer.identifierEquals(FnvHash.Constants.CHARSET)) {
|
||||
lexer.nextToken();
|
||||
|
||||
if (lexer.token != Token.IDENTIFIER
|
||||
&& lexer.token != Token.LITERAL_CHARS
|
||||
&& lexer.token != Token.BINARY) {
|
||||
|
||||
@@ -600,8 +600,10 @@ public class SQLStatementParser extends SQLParser {
|
||||
stmt.setExpr(expr);
|
||||
}
|
||||
|
||||
accept(Token.SEMI);
|
||||
stmt.setAfterSemi(true);
|
||||
if (lexer.token == Token.SEMI) {
|
||||
lexer.nextToken();
|
||||
stmt.setAfterSemi(true);
|
||||
}
|
||||
|
||||
return stmt;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user