mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for sql server parser. for issue #1795
This commit is contained in:
+2
@@ -163,6 +163,8 @@ public class SQLServerSelectParser extends SQLSelectParser {
|
||||
|
||||
parseGroupBy(queryBlock);
|
||||
|
||||
queryBlock.setOrderBy(this.exprParser.parseOrderBy());
|
||||
|
||||
parseFetchClause(queryBlock);
|
||||
|
||||
return queryRest(queryBlock);
|
||||
|
||||
+10
-2
@@ -16,6 +16,7 @@
|
||||
package com.alibaba.druid.sql.dialect.sqlserver.visitor;
|
||||
|
||||
import com.alibaba.druid.sql.ast.SQLName;
|
||||
import com.alibaba.druid.sql.ast.SQLOrderBy;
|
||||
import com.alibaba.druid.sql.ast.SQLSetQuantifier;
|
||||
import com.alibaba.druid.sql.ast.SQLStatement;
|
||||
import com.alibaba.druid.sql.ast.statement.*;
|
||||
@@ -82,9 +83,16 @@ public class SQLServerOutputVisitor extends SQLASTOutputVisitor implements SQLSe
|
||||
x.getWhere().accept(this);
|
||||
}
|
||||
|
||||
if (x.getGroupBy() != null) {
|
||||
SQLSelectGroupByClause groupBy = x.getGroupBy();
|
||||
if (groupBy != null) {
|
||||
println();
|
||||
x.getGroupBy().accept(this);
|
||||
groupBy.accept(this);
|
||||
}
|
||||
|
||||
SQLOrderBy orderBy = x.getOrderBy();
|
||||
if (orderBy != null) {
|
||||
println();
|
||||
orderBy.accept(this);
|
||||
}
|
||||
|
||||
printFetchFirst(x);
|
||||
|
||||
Reference in New Issue
Block a user