mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for sql parser. for issue #2488
This commit is contained in:
@@ -2421,6 +2421,10 @@ public class MySqlStatementParser extends SQLStatementParser {
|
||||
lexer.nextToken();
|
||||
}
|
||||
|
||||
if (lexer.token() == Token.LINE_COMMENT) {
|
||||
lexer.nextToken();
|
||||
}
|
||||
|
||||
tableName = this.exprParser.name();
|
||||
stmt.setTableName(tableName);
|
||||
|
||||
@@ -2540,6 +2544,10 @@ public class MySqlStatementParser extends SQLStatementParser {
|
||||
}
|
||||
}
|
||||
|
||||
if (lexer.token() == Token.LINE_COMMENT) {
|
||||
lexer.nextToken();
|
||||
}
|
||||
|
||||
if (lexer.token() == Token.VALUES || lexer.identifierEquals(FnvHash.Constants.VALUE)) {
|
||||
lexer.nextTokenLParen();
|
||||
parseValueClause(stmt.getValuesList(), columnSize, stmt);
|
||||
|
||||
@@ -1492,7 +1492,7 @@ public class SQLExprParser extends SQLParser {
|
||||
}
|
||||
|
||||
SQLOver.WindowingType windowingType = null;
|
||||
if (lexer.identifierEquals(FnvHash.Constants.ROWS)) {
|
||||
if (lexer.identifierEquals(FnvHash.Constants.ROWS) || lexer.token == Token.ROWS) {
|
||||
windowingType = SQLOver.WindowingType.ROWS;
|
||||
|
||||
} else if (lexer.identifierEquals(FnvHash.Constants.RANGE)) {
|
||||
@@ -1519,7 +1519,7 @@ public class SQLExprParser extends SQLParser {
|
||||
accept(Token.AND);
|
||||
|
||||
SQLExpr betweenEnd;
|
||||
if (lexer.identifierEquals(FnvHash.Constants.CURRENT)) {
|
||||
if (lexer.identifierEquals(FnvHash.Constants.CURRENT) || lexer.token == Token.CURRENT) {
|
||||
lexer.nextToken();
|
||||
if (lexer.identifierEquals(FnvHash.Constants.ROW)) {
|
||||
lexer.nextToken();
|
||||
|
||||
Reference in New Issue
Block a user