improved sql parser. fixed issue #1311

This commit is contained in:
高铁
2016-06-29 02:01:22 +08:00
parent 1c1e28e103
commit eb5c8d708e
5 changed files with 100 additions and 10 deletions
@@ -20,6 +20,7 @@ import java.util.List;
import com.alibaba.druid.sql.ast.SQLExpr;
import com.alibaba.druid.sql.ast.SQLObjectImpl;
import com.alibaba.druid.sql.ast.SQLOrderBy;
import com.alibaba.druid.sql.visitor.SQLASTVisitor;
public class SQLSelectQueryBlock extends SQLObjectImpl implements SQLSelectQuery {
@@ -31,6 +32,7 @@ public class SQLSelectQueryBlock extends SQLObjectImpl implements SQLSelectQuery
protected SQLExprTableSource into;
protected SQLExpr where;
protected SQLSelectGroupByClause groupBy;
protected SQLOrderBy orderBy;
protected boolean parenthesized = false;
public SQLSelectQueryBlock(){
@@ -70,6 +72,18 @@ public class SQLSelectQueryBlock extends SQLObjectImpl implements SQLSelectQuery
}
this.where = where;
}
public SQLOrderBy getOrderBy() {
return orderBy;
}
public void setOrderBy(SQLOrderBy orderBy) {
if (orderBy != null) {
orderBy.setParent(this);
}
this.orderBy = orderBy;
}
public int getDistionOption() {
return this.distionOption;