Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LIMIT参数不能是Long类型 #317

Closed
zuoqinbo opened this issue Aug 8, 2017 · 0 comments
Closed

LIMIT参数不能是Long类型 #317

zuoqinbo opened this issue Aug 8, 2017 · 0 comments

Comments

@zuoqinbo
Copy link

zuoqinbo commented Aug 8, 2017

Please answer these questions before submitting your issue. Thanks!

Which version of Sharding-Jdbc do you using?

<sharding-jdbc.version>1.5.0</sharding-jdbc.version>

Expected behavior

查询条件:LIMIT #{startIndex},#{pageSize}
当 startIndex 是一个Long类型 能正常运行,有返回结果。

Actual behavior

7z r 2 2j to p kgzvcqvt
导致问题: Caused by: com.dangdang.ddframe.rdb.sharding.exception.ShardingJdbcException: Invalid value to transfer: 0
at com.dangdang.ddframe.rdb.sharding.util.NumberUtil.roundHalfUp(NumberUtil.java:55) ~[sharding-jdbc-core-1.5.0.jar:na]
at com.dangdang.ddframe.rdb.sharding.parsing.parser.context.limit.Limit.fill(Limit.java:82) ~[sharding-jdbc-core-1.5.0.jar:na]
at com.dangdang.ddframe.rdb.sharding.parsing.parser.context.limit.Limit.processParameters(Limit.java:73) ~[sharding-jdbc-core-1.5.0.jar:na]
at com.dangdang.ddframe.rdb.sharding.routing.router.ParsingSQLRouter.processLimit(ParsingSQLRouter.java:147) ~[sharding-jdbc-core-1.5.0.jar:na]
at com.dangdang.ddframe.rdb.sharding.routing.router.ParsingSQLRouter.route(ParsingSQLRouter.java:93) ~[sharding-jdbc-core-1.5.0.jar:na]

Steps to reproduce the behavior

查询条件:LIMIT #{startIndex},#{pageSize}
startIndex 传入一个Long类型

Please provide the reproduce example codes (such as github link) if possible.

haocao added a commit that referenced this issue Aug 9, 2017
@haocao haocao closed this as completed Aug 10, 2017
@terrymanu terrymanu changed the title 分页Limit参数问题 LIMIT参数不能是Long类型 Aug 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants