mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved sql parser, bug fixed for parent is null
This commit is contained in:
@@ -48,6 +48,13 @@ public class PGWithQuery extends PGSQLObjectImpl {
|
||||
return columns;
|
||||
}
|
||||
|
||||
public void addColumn(SQLExpr column) {
|
||||
if (column != null) {
|
||||
column.setParent(this);
|
||||
}
|
||||
this.columns.add(column);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept0(PGASTVisitor visitor) {
|
||||
if (visitor.visit(this)) {
|
||||
|
||||
+1
-1
@@ -254,7 +254,7 @@ public class PGSQLStatementParser extends SQLStatementParser {
|
||||
|
||||
for (;;) {
|
||||
SQLExpr expr = this.exprParser.expr();
|
||||
withQuery.getColumns().add(expr);
|
||||
withQuery.addColumn(expr);
|
||||
if (lexer.token() == Token.COMMA) {
|
||||
lexer.nextToken();
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user