mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improve Oracle SQL Parser
This commit is contained in:
@@ -234,7 +234,7 @@ public class SQLStatementParser extends SQLParser {
|
||||
|
||||
SQLRollbackStatement stmt = new SQLRollbackStatement();
|
||||
|
||||
if (identifierEquals("TO")) {
|
||||
if (lexer.token() == Token.TO) {
|
||||
lexer.nextToken();
|
||||
|
||||
if (identifierEquals("SAVEPOINT")) {
|
||||
@@ -439,7 +439,7 @@ public class SQLStatementParser extends SQLParser {
|
||||
exprParser.exprList(stmt.getParameters());
|
||||
accept(Token.RPAREN);
|
||||
}
|
||||
|
||||
|
||||
if (brace) {
|
||||
accept(Token.RBRACE);
|
||||
}
|
||||
@@ -496,12 +496,26 @@ public class SQLStatementParser extends SQLParser {
|
||||
// lexer.reset(mark_bp, mark_ch, Token.CREATE);
|
||||
throw new ParserException("TODO " + lexer.token() + " " + lexer.stringVal());
|
||||
} else if (token == Token.DATABASE) {
|
||||
lexer.nextToken();
|
||||
if (identifierEquals("LINK")) {
|
||||
lexer.reset(markBp, markChar, Token.CREATE);
|
||||
return parseCreateDbLink();
|
||||
}
|
||||
|
||||
lexer.reset(markBp, markChar, Token.CREATE);
|
||||
return parseCreateDatabase();
|
||||
} else if (identifierEquals("PUBLIC") || identifierEquals("SHARE")) {
|
||||
lexer.reset(markBp, markChar, Token.CREATE);
|
||||
return parseCreateDbLink();
|
||||
}
|
||||
|
||||
throw new ParserException("TODO " + lexer.token());
|
||||
}
|
||||
|
||||
public SQLStatement parseCreateDbLink() {
|
||||
throw new ParserException("TODO " + lexer.token());
|
||||
}
|
||||
|
||||
public SQLStatement parseCreateDatabase() {
|
||||
if (lexer.token() == Token.CREATE) {
|
||||
lexer.nextToken();
|
||||
|
||||
Reference in New Issue
Block a user