提交 4f2fa737 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Use long arithmetic to avoid overflow

上级 f4591330
...@@ -396,7 +396,7 @@ public class LocalResult implements ResultInterface, ResultTarget { ...@@ -396,7 +396,7 @@ public class LocalResult implements ResultInterface, ResultTarget {
throw DbException.getInvalidValueException("FETCH PERCENT", limit); throw DbException.getInvalidValueException("FETCH PERCENT", limit);
} }
// Oracle rounds percent up, do the same for now // Oracle rounds percent up, do the same for now
limit = (limit * rowCount + 99) / 100; limit = (int) (((long) limit * rowCount + 99) / 100);
} }
boolean clearAll = offset >= rowCount || limit == 0; boolean clearAll = offset >= rowCount || limit == 0;
if (!clearAll) { if (!clearAll) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论