mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved sql parser.
This commit is contained in:
@@ -392,7 +392,7 @@ public class SQLStatementParser extends SQLParser {
|
||||
if (lexer.token() == Token.TO) {
|
||||
lexer.nextToken();
|
||||
|
||||
if (identifierEquals("SAVEPOINT")) {
|
||||
if (identifierEquals("SAVEPOINT") || lexer.token() == Token.SAVEPOINT) {
|
||||
lexer.nextToken();
|
||||
}
|
||||
|
||||
@@ -1650,6 +1650,10 @@ public class SQLStatementParser extends SQLParser {
|
||||
}
|
||||
}
|
||||
|
||||
public SQLStatement parseCreatePackage() {
|
||||
throw new ParserException("TODO " + lexer.info());
|
||||
}
|
||||
|
||||
public SQLStatement parseCreate() {
|
||||
char markChar = lexer.current();
|
||||
int markBp = lexer.bp();
|
||||
@@ -1696,6 +1700,11 @@ public class SQLStatementParser extends SQLParser {
|
||||
return parseCreateView();
|
||||
}
|
||||
|
||||
if (identifierEquals("PACKAGE")) {
|
||||
lexer.reset(markBp, markChar, Token.CREATE);
|
||||
return parseCreatePackage();
|
||||
}
|
||||
|
||||
// lexer.reset(mark_bp, mark_ch, Token.CREATE);
|
||||
throw new ParserException("TODO " + lexer.token() + " " + lexer.stringVal());
|
||||
} else if (token == Token.DATABASE) {
|
||||
|
||||
Reference in New Issue
Block a user