mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
refactor
This commit is contained in:
@@ -402,7 +402,7 @@ public class OracleExprParser extends SQLExprParser {
|
||||
expr = interval;
|
||||
}
|
||||
|
||||
if (lexer.token() == Token.AT) {
|
||||
if (identifierEquals("AT")) {
|
||||
char mark_ch = lexer.current();
|
||||
int mark_bp = lexer.bp();
|
||||
lexer.nextToken();
|
||||
@@ -410,10 +410,10 @@ public class OracleExprParser extends SQLExprParser {
|
||||
lexer.nextToken();
|
||||
expr = new OracleDatetimeExpr(expr, new SQLIdentifierExpr("LOCAL"));
|
||||
} else {
|
||||
if (lexer.token() == Token.TIME) {
|
||||
if (identifierEquals("TIME")) {
|
||||
lexer.nextToken();
|
||||
} else {
|
||||
lexer.reset(mark_bp, mark_ch, Token.AT);
|
||||
lexer.reset(mark_bp, mark_ch, Token.IDENTIFIER);
|
||||
return expr;
|
||||
}
|
||||
accept(Token.ZONE);
|
||||
|
||||
@@ -104,7 +104,6 @@ public class OracleLexer extends Lexer {
|
||||
map.put("MERGE", Token.MERGE);
|
||||
map.put("USING", Token.USING);
|
||||
map.put("MATCHED", Token.MATCHED);
|
||||
map.put("LOG", Token.LOG);
|
||||
map.put("ERRORS", Token.ERRORS);
|
||||
map.put("REJECT", Token.REJECT);
|
||||
map.put("UNLIMITED", Token.UNLIMITED);
|
||||
@@ -119,9 +118,7 @@ public class OracleLexer extends Lexer {
|
||||
map.put("NOWAIT", Token.NOWAIT);
|
||||
map.put("SESSION", Token.SESSION);
|
||||
map.put("PROCEDURE", Token.PROCEDURE);
|
||||
map.put("AT", Token.AT);
|
||||
map.put("LOCAL", Token.LOCAL);
|
||||
map.put("TIME", Token.TIME);
|
||||
map.put("ZONE", Token.ZONE);
|
||||
map.put("SYSDATE", Token.SYSDATE);
|
||||
map.put("DECLARE", Token.DECLARE);
|
||||
|
||||
+3
-3
@@ -592,7 +592,7 @@ public class OracleStatementParser extends SQLStatementParser {
|
||||
|
||||
if (identifierEquals("SNAPSHOT")) {
|
||||
lexer.nextToken();
|
||||
accept(Token.LOG);
|
||||
acceptIdentifier("LOG");
|
||||
stmt.setPurgeSnapshotLog(true);
|
||||
} else {
|
||||
throw new ParserException("TODO : " + lexer.token() + " " + lexer.stringVal());
|
||||
@@ -964,7 +964,7 @@ public class OracleStatementParser extends SQLStatementParser {
|
||||
OracleAlterTableSplitPartition item = new OracleAlterTableSplitPartition();
|
||||
item.setName(this.exprParser.name());
|
||||
|
||||
if (lexer.token() == Token.AT) {
|
||||
if (identifierEquals("AT")) {
|
||||
lexer.nextToken();
|
||||
accept(Token.LPAREN);
|
||||
this.exprParser.exprList(item.getAt());
|
||||
@@ -1340,7 +1340,7 @@ public class OracleStatementParser extends SQLStatementParser {
|
||||
}
|
||||
|
||||
private OracleErrorLoggingClause parseErrorLoggingClause() {
|
||||
if (lexer.token() == Token.LOG) {
|
||||
if (identifierEquals("LOG")) {
|
||||
OracleErrorLoggingClause errorClause = new OracleErrorLoggingClause();
|
||||
|
||||
lexer.nextToken();
|
||||
|
||||
@@ -217,12 +217,9 @@ public class SQLExprParser extends SQLParser {
|
||||
case REFERENCE:
|
||||
case KEY:
|
||||
case DISTINCT:
|
||||
case TIME:
|
||||
case ZONE:
|
||||
case LOG:
|
||||
case LIMIT:
|
||||
case SCHEMA:
|
||||
case AT:
|
||||
case COLUMN:
|
||||
case IF:
|
||||
sqlExpr = new SQLIdentifierExpr(lexer.stringVal());
|
||||
|
||||
@@ -96,8 +96,7 @@ public class SQLParser {
|
||||
} else if (lexer.token() == Token.LITERAL_CHARS) {
|
||||
alias = "'" + lexer.stringVal() + "'";
|
||||
lexer.nextToken();
|
||||
} else if (lexer.token() == Token.TIME || lexer.token() == Token.CASE || lexer.token() == Token.AT
|
||||
|| lexer.token() == Token.LOG) {
|
||||
} else if (lexer.token() == Token.CASE) {
|
||||
alias = lexer.token.name();
|
||||
lexer.nextToken();
|
||||
}
|
||||
|
||||
@@ -145,7 +145,6 @@ public enum Token {
|
||||
MODEL("MODEL"),
|
||||
MERGE("MERGE"),
|
||||
MATCHED("MATCHED"),
|
||||
LOG("LOG"),
|
||||
ERRORS("ERRORS"),
|
||||
REJECT("REJECT"),
|
||||
UNLIMITED("UNLIMITED"),
|
||||
@@ -156,9 +155,7 @@ public enum Token {
|
||||
ADVISE("ADVISE"),
|
||||
SESSION("SESSION"),
|
||||
PROCEDURE("PROCEDURE"),
|
||||
AT("AT"),
|
||||
LOCAL("LOCAL"),
|
||||
TIME("TIME"),
|
||||
ZONE("ZONE"),
|
||||
SYSDATE("SYSDATE"),
|
||||
DECLARE("DECLARE"),
|
||||
|
||||
Reference in New Issue
Block a user