mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
refactor
This commit is contained in:
+17
-15
@@ -45,26 +45,28 @@ public class SQLServerSelectParser extends SQLSelectParser {
|
||||
return queryRest(select);
|
||||
}
|
||||
|
||||
accept(Token.SELECT);
|
||||
|
||||
SQLServerSelectQueryBlock queryBlock = new SQLServerSelectQueryBlock();
|
||||
|
||||
if (lexer.token() == Token.DISTINCT) {
|
||||
queryBlock.setDistionOption(SQLSetQuantifier.DISTINCT);
|
||||
if (lexer.token() == Token.SELECT) {
|
||||
lexer.nextToken();
|
||||
} else if (lexer.token() == Token.ALL) {
|
||||
queryBlock.setDistionOption(SQLSetQuantifier.ALL);
|
||||
lexer.nextToken();
|
||||
}
|
||||
|
||||
if (lexer.token() == Token.TOP) {
|
||||
Top top = new Top();
|
||||
lexer.nextToken();
|
||||
top.setExpr(createExprParser().primary());
|
||||
queryBlock.setTop(top);
|
||||
}
|
||||
if (lexer.token() == Token.DISTINCT) {
|
||||
queryBlock.setDistionOption(SQLSetQuantifier.DISTINCT);
|
||||
lexer.nextToken();
|
||||
} else if (lexer.token() == Token.ALL) {
|
||||
queryBlock.setDistionOption(SQLSetQuantifier.ALL);
|
||||
lexer.nextToken();
|
||||
}
|
||||
|
||||
parseSelectList(queryBlock);
|
||||
if (lexer.token() == Token.TOP) {
|
||||
Top top = new Top();
|
||||
lexer.nextToken();
|
||||
top.setExpr(createExprParser().primary());
|
||||
queryBlock.setTop(top);
|
||||
}
|
||||
|
||||
parseSelectList(queryBlock);
|
||||
}
|
||||
|
||||
parseFrom(queryBlock);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user