mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed sql parser grouping sets
This commit is contained in:
@@ -169,9 +169,11 @@ public class SQLASTOutputVisitor extends SQLASTVisitorAdapter implements Printab
|
||||
private String indent = "\t";
|
||||
private int indentCount = 0;
|
||||
private boolean prettyFormat = true;
|
||||
protected boolean ucase = true;
|
||||
protected boolean ucase = true;
|
||||
protected int selectListNumberOfLine = 5;
|
||||
|
||||
protected boolean groupItemSingleLine = false;
|
||||
|
||||
private List<Object> parameters;
|
||||
|
||||
public SQLASTOutputVisitor(Appendable appender){
|
||||
@@ -734,9 +736,17 @@ public class SQLASTOutputVisitor extends SQLASTVisitorAdapter implements Printab
|
||||
}
|
||||
|
||||
public boolean visit(SQLSelectGroupByClause x) {
|
||||
if (x.getItems().size() > 0) {
|
||||
int itemSize = x.getItems().size();
|
||||
if (itemSize > 0) {
|
||||
print0(ucase ? "GROUP BY " : "group by ");
|
||||
printAndAccept(x.getItems(), ", ");
|
||||
incrementIndent();
|
||||
for (int i = 0; i < itemSize; ++i) {
|
||||
if (i != 0) {
|
||||
println(", ");
|
||||
}
|
||||
x.getItems().get(i).accept(this);
|
||||
}
|
||||
decrementIndent();
|
||||
}
|
||||
|
||||
if (x.getHaving() != null) {
|
||||
|
||||
Reference in New Issue
Block a user