mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved oracle sql parser support fetch clause. issue #1448
This commit is contained in:
@@ -540,4 +540,25 @@ public class SQLSelectParser extends SQLParser {
|
||||
}
|
||||
}
|
||||
|
||||
public void parseFetchClause(SQLSelectQueryBlock queryBlock) {
|
||||
if (lexer.token() == Token.FETCH) {
|
||||
lexer.nextToken();
|
||||
if (lexer.token() == Token.FIRST) {
|
||||
lexer.nextToken();
|
||||
} else {
|
||||
acceptIdentifier("FIRST");
|
||||
}
|
||||
SQLExpr first = this.exprParser.primary();
|
||||
queryBlock.setFirst(first);
|
||||
if (identifierEquals("ROW") || identifierEquals("ROWS")) {
|
||||
lexer.nextToken();
|
||||
}
|
||||
|
||||
if (lexer.token() == Token.ONLY) {
|
||||
lexer.nextToken();
|
||||
} else {
|
||||
acceptIdentifier("ONLY");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user