mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
enhance sql parser
This commit is contained in:
@@ -40,7 +40,7 @@ public class MySqlSelectParser extends SQLSelectParser {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SQLSelectQuery query() throws ParserException {
|
||||
public SQLSelectQuery query() throws ParserException {
|
||||
if (lexer.token() == (Token.LPAREN)) {
|
||||
lexer.nextToken();
|
||||
|
||||
|
||||
@@ -229,7 +229,7 @@ public class OracleSelectParser extends SQLSelectParser {
|
||||
return select;
|
||||
}
|
||||
|
||||
protected SQLSelectQuery query() {
|
||||
public SQLSelectQuery query() {
|
||||
if (lexer.token() == (Token.LPAREN)) {
|
||||
lexer.nextToken();
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ public class PGSelectParser extends SQLSelectParser {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SQLSelectQuery query() throws ParserException {
|
||||
public SQLSelectQuery query() throws ParserException {
|
||||
PGSelectQueryBlock queryBlock = new PGSelectQueryBlock();
|
||||
|
||||
accept(Token.SELECT);
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ public class SQLServerSelectParser extends SQLSelectParser {
|
||||
return select;
|
||||
}
|
||||
|
||||
protected SQLSelectQuery query() throws ParserException {
|
||||
public SQLSelectQuery query() throws ParserException {
|
||||
if (lexer.token() == Token.LPAREN) {
|
||||
lexer.nextToken();
|
||||
|
||||
|
||||
@@ -28,6 +28,10 @@ public class SQLParser {
|
||||
this.lexer = lexer;
|
||||
}
|
||||
|
||||
public final Lexer getLexer() {
|
||||
return lexer;
|
||||
}
|
||||
|
||||
protected boolean identifierEquals(String text) {
|
||||
return lexer.token() == Token.IDENTIFIER && lexer.stringVal().equalsIgnoreCase(text);
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ public class SQLSelectParser extends SQLParser {
|
||||
return selectQuery;
|
||||
}
|
||||
|
||||
protected SQLSelectQuery query() throws ParserException {
|
||||
public SQLSelectQuery query() throws ParserException {
|
||||
if (lexer.token() == Token.LPAREN) {
|
||||
lexer.nextToken();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user