mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
mysql parser refactor.
This commit is contained in:
@@ -299,7 +299,14 @@ public class PagerUtils {
|
||||
|
||||
if (query instanceof SQLSelectQueryBlock) {
|
||||
OracleSelectQueryBlock queryBlock = (OracleSelectQueryBlock) query;
|
||||
if (queryBlock.getGroupBy() == null && select.getOrderBy() == null && offset <= 0) {
|
||||
SQLOrderBy orderBy = select.getOrderBy();
|
||||
if (orderBy == null && queryBlock.getOrderBy() != null) {
|
||||
orderBy = queryBlock.getOrderBy();
|
||||
}
|
||||
|
||||
if (queryBlock.getGroupBy() == null
|
||||
&& orderBy == null && offset <= 0) {
|
||||
|
||||
SQLExpr where = queryBlock.getWhere();
|
||||
if (check && where instanceof SQLBinaryOpExpr) {
|
||||
SQLBinaryOpExpr binaryOpWhere = (SQLBinaryOpExpr) where;
|
||||
@@ -664,12 +671,16 @@ public class PagerUtils {
|
||||
|
||||
|
||||
if (selectQuery != null) {
|
||||
SQLOrderBy orderBy = selectQuery.getOrderBy();
|
||||
|
||||
SQLObject parent = selectQuery.getParent();
|
||||
if (parent instanceof SQLSelect) {
|
||||
if (orderBy == null && parent instanceof SQLSelect) {
|
||||
SQLSelect select = (SQLSelect) parent;
|
||||
if (select.getOrderBy() == null || select.getOrderBy().getItems().size() == 0) {
|
||||
unorderedLimitCount++;
|
||||
}
|
||||
orderBy = select.getOrderBy();
|
||||
}
|
||||
|
||||
if (orderBy == null || orderBy.getItems().size() == 0) {
|
||||
unorderedLimitCount++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user