mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for sql parser. for issue #1789
This commit is contained in:
@@ -1382,6 +1382,15 @@ public class SQLExprParser extends SQLParser {
|
||||
SQLInListExpr inListExpr = new SQLInListExpr(expr);
|
||||
if (lexer.token() == Token.LPAREN) {
|
||||
lexer.nextToken();
|
||||
|
||||
if (lexer.token() == Token.WITH) {
|
||||
SQLSelect select = this.createSelectParser().select();
|
||||
SQLInSubQueryExpr queryExpr = new SQLInSubQueryExpr(select);
|
||||
queryExpr.setExpr(expr);
|
||||
accept(Token.RPAREN);
|
||||
return queryExpr;
|
||||
}
|
||||
|
||||
exprList(inListExpr.getTargetList(), inListExpr);
|
||||
accept(Token.RPAREN);
|
||||
expr = inListExpr;
|
||||
|
||||
@@ -2661,7 +2661,7 @@ public class SQLASTOutputVisitor extends SQLASTVisitorAdapter implements Paramet
|
||||
public boolean visit(SQLWithSubqueryClause x) {
|
||||
print0(ucase ? "WITH " : "with ");
|
||||
if (x.getRecursive() == Boolean.TRUE) {
|
||||
print0(ucase ? "RECURSIVE " : " recursive ");
|
||||
print0(ucase ? "RECURSIVE " : "recursive ");
|
||||
}
|
||||
incrementIndent();
|
||||
printlnAndAccept(x.getEntries(), ", ");
|
||||
|
||||
Reference in New Issue
Block a user