mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved mysql parser.
This commit is contained in:
+3
-1
@@ -90,7 +90,9 @@ public class MySqlReplaceStatement extends MySqlStatementImpl {
|
||||
}
|
||||
|
||||
public void setQuery(SQLQueryExpr query) {
|
||||
query.setParent(this);
|
||||
if (query != null) {
|
||||
query.setParent(this);
|
||||
}
|
||||
this.query = query;
|
||||
}
|
||||
|
||||
|
||||
@@ -1850,10 +1850,9 @@ public class MySqlStatementParser extends SQLStatementParser {
|
||||
break;
|
||||
}
|
||||
} else if (lexer.token() == Token.LPAREN) {
|
||||
lexer.nextToken();
|
||||
SQLQueryExpr queryExpr = (SQLQueryExpr) this.exprParser.expr();
|
||||
SQLSelect select = this.createSQLSelectParser().select();
|
||||
SQLQueryExpr queryExpr = new SQLQueryExpr(select);
|
||||
stmt.setQuery(queryExpr);
|
||||
accept(Token.RPAREN);
|
||||
}
|
||||
|
||||
return stmt;
|
||||
|
||||
@@ -240,6 +240,7 @@ public class SQLParser {
|
||||
case ADVISE:
|
||||
case TYPE:
|
||||
case CLOSE:
|
||||
case OPEN:
|
||||
alias = lexer.stringVal();
|
||||
lexer.nextToken();
|
||||
return alias;
|
||||
|
||||
Reference in New Issue
Block a user