Skip to content

Commit

Permalink
* 对sqlserver优化
Browse files Browse the repository at this point in the history
  • Loading branch information
bes2008 committed Sep 6, 2021
1 parent c1effbd commit 06c9eda
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private int bindLimitParameters(RowSelection selection, PreparedStatement statem
}
long firstRow = convertToFirstRowValue(LimitHelper.getFirstRow(selection));
int lastRow = getMaxOrLimit(selection);
boolean hasFirstRow = (getDialect().isSupportsLimitOffset()) && ((firstRow > 0) || (getDialect().isForceLimitUsage()));
boolean hasFirstRow = getDialect().isSupportsLimitOffset() && ((firstRow > 0) || (getDialect().isForceLimitUsage()));
boolean reverse = getDialect().isBindLimitParametersInReverseOrder();
if (hasFirstRow) {
statement.setInt(index + (reverse ? 1 : 0), Long.valueOf(firstRow).intValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
* offset ? rows fetch next ? rows only
* <p>
* every dialect use the limitHandler should set bindLimitParameterInReverseOrder = false
*
*
* 需要注意的是,offset fetch 通常是在 order by 之后
*/
public class OffsetFetchFirstOnlyLimitHandler extends AbstractLimitHandler {

Expand Down

0 comments on commit 06c9eda

Please sign in to comment.