Skip to content

Commit

Permalink
fix #375
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed Sep 12, 2017
1 parent fdeac9b commit 88f95e8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
1. [ISSUE #356](https://github.com/dangdangdotcom/sharding-jdbc/issues/356) 在SQL的Where条件中兼容不是分片列的REGEXP操作符
1. [ISSUE #362](https://github.com/dangdangdotcom/sharding-jdbc/issues/362) 读写分离使用PreparedStatement并未调用setParameter方法导致出错
1. [ISSUE #370](https://github.com/dangdangdotcom/sharding-jdbc/issues/370) 使用原生自增主键调用getGeneratedKeys出错
1. [ISSUE #375](https://github.com/dangdangdotcom/sharding-jdbc/issues/375) 路由至单节点的分页第二页以后的查询取不到数据

## 1.5.3

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,11 @@ public int getRowCountValue() {
* Fill parameters for rewrite limit.
*
* @param parameters parameters
* @param isRewrite is rewrite or not
* @param isFetchAll is fetch all data or not
*/
public void processParameters(final List<Object> parameters, final boolean isRewrite, final boolean isFetchAll) {
public void processParameters(final List<Object> parameters, final boolean isFetchAll) {
fill(parameters);
if (isRewrite) {
rewrite(parameters, isFetchAll);
}
rewrite(parameters, isFetchAll);
}

private void fill(final List<Object> parameters) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,11 @@ private void setGeneratedKeys(final SQLRouteResult sqlRouteResult, final Number
}

private void processLimit(final List<Object> parameters, final SelectStatement selectStatement, final boolean isSingleRouting) {
if (isSingleRouting) {
selectStatement.setLimit(null);
return;
}
boolean isNeedFetchAll = (!selectStatement.getGroupByItems().isEmpty() || !selectStatement.getAggregationSelectItems().isEmpty()) && !selectStatement.isSameGroupByAndOrderByItems();
selectStatement.getLimit().processParameters(parameters, !isSingleRouting, isNeedFetchAll);
selectStatement.getLimit().processParameters(parameters, isNeedFetchAll);
}
}

0 comments on commit 88f95e8

Please sign in to comment.