sharing-jdbc ParameterList 数组越界
### SQL: SELECT t.TRANS_ID as transNo, t.CUST_NAME as paymengtName, t.TRANS_AMOUNT as payAmount, t.TRANS_TIME as payDate, PAYTYPE as payType, PAYTYPE as payChannel, t.TERMIN_IDENTIFY as terminalId, t.OPERATOR_NO as operator, t.TRANS_STATUS as payStatus, t.OPERATOR_NAME as operatorName, t.CNAME as plotName, RECORD_COMPANY_NAME as companyName, t.PHONE as mobel, t.trans_status as transStatus, t.TRANS_TYPE as chargeType, t.CHARGE_MARK as chargeMark FROM BS_TRANS_JOURNALS t JOIN BS_TRANSPAY_JOURNALS p on p.TRANS_ID = t.TRANS_ID WHERE t.CID = ? and t.OPERATOR_NAME like CONCAT('%', ?, '%') AND t.TRANS_STATUS IN ( ? ) AND STR_TO_DATE(t.TRANS_TIME, '%Y%m%d') >= STR_TO_DATE(?, '%Y%m%d') AND STR_TO_DATE(t.TRANS_TIME, '%Y%m%d') < STR_TO_DATE(?, '%Y%m%d') AND p.PAYTYPE IN ( ? ) AND p.PAYTYPE IN ( ? ) order by t.TRANS_TIME desc LIMIT ?,?
### Cause: java.lang.IndexOutOfBoundsException: Index: 7, Size: 2
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:150)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)
at sun.reflect.GeneratedMethodAccessor251.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:434)
... 52 common frames omitted
Caused by: java.lang.IndexOutOfBoundsException: Index: 7, Size: 2
at java.util.ArrayList.rangeCheck(ArrayList.java:635)
at java.util.ArrayList.get(ArrayList.java:411)
at com.dangdang.ddframe.rdb.sharding.jdbc.util.ParameterList.set(ParameterList.java:89)
at com.dangdang.ddframe.rdb.sharding.parser.result.merger.Limit.replaceParameters(Limit.java:71)
at com.dangdang.ddframe.rdb.sharding.router.SQLRouteEngine.routeSQL(SQLRouteEngine.java:105)
at com.dangdang.ddframe.rdb.sharding.router.PreparedSQLRouter.route(PreparedSQLRouter.java:66)
at com.dangdang.ddframe.rdb.sharding.jdbc.ShardingPreparedStatement.routeSQL(ShardingPreparedStatement.java:163)
at com.dangdang.ddframe.rdb.sharding.jdbc.ShardingPreparedStatement.execute(ShardingPreparedStatement.java:112)
at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:63)
at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79)
at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:63)
at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:325)
at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83)
at sun.reflect.GeneratedMethodAccessor249.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49)
at com.icip.framework.page.pagehelper.SqlUtil._processPage(SqlUtil.java:352)
at com.icip.framework.page.pagehelper.SqlUtil.processPage(SqlUtil.java:330)
at com.icip.framework.page.pagehelper.PageHelper.intercept(PageHelper.java:152)
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61)
at com.sun.proxy.$Proxy120.query(Unknown Source)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148)
... 57 common frames omitted
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个是解析的bug,应该是没有解析括号里面的问号。感谢使用和反馈。
将于1.5.0稳定版中修复