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:
@@ -279,6 +279,12 @@ public class SQLSelectParser extends SQLParser {
|
||||
accept(Token.BY);
|
||||
|
||||
SQLSelectGroupByClause groupBy = new SQLSelectGroupByClause();
|
||||
if (identifierEquals("ROLLUP")) {
|
||||
lexer.nextToken();
|
||||
accept(Token.LPAREN);
|
||||
groupBy.setWithRollUp(true);
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
SQLExpr item = parseGroupByItem();
|
||||
|
||||
@@ -291,6 +297,9 @@ public class SQLSelectParser extends SQLParser {
|
||||
|
||||
lexer.nextToken();
|
||||
}
|
||||
if (groupBy.isWithRollUp()) {
|
||||
accept(Token.RPAREN);
|
||||
}
|
||||
|
||||
if (lexer.token() == (Token.HAVING)) {
|
||||
lexer.nextToken();
|
||||
|
||||
Reference in New Issue
Block a user