<p dir="auto">org.apache.shardingsphere.core.optimize.sharding.segment.select.pagination.Pagination</p>
<p dir="auto">private int getValue(PaginationValueSegment paginationValueSegment, List parameters) {<br>
return paginationValueSegment instanceof ParameterMarkerPaginationValueSegment ? **(Integer)**parameters.get(((ParameterMarkerPaginationValueSegment)paginationValueSegment).getParameterIndex()) : ((NumberLiteralPaginationValueSegment)paginationValueSegment).getValue();<br>
}</p><p dir="auto"></p><p></p>
<h2 dir="auto">Bug Report</h2>
<p dir="auto"><strong>For English only</strong>, other languages will not accept.</p>
<p dir="auto">Before report a bug, make sure you have:</p>
<ul dir="auto">
<li>Searched open and closed <a href="https://github.com/apache/incubator-shardingsphere/issues">GitHub issues</a>.</li>
<li>Read documentation: <a href="https://shardingsphere.apache.org/document/current/en/overview" rel="nofollow">ShardingSphere Doc</a>.</li>
</ul>
<p dir="auto">Please pay attention on issues you submitted, because we maybe need more details.<br>
If no response <strong>more than 7 days</strong> and we cannot reproduce it on current information, we will <strong>close it</strong>.</p>
<p dir="auto">Please answer these questions before submitting your issue. Thanks!</p>
<h3 dir="auto">Which version of ShardingSphere did you use?</h3>
<p dir="auto">4.0.0-RC2-SNAPSHOT(clone from dev branch)</p>
<h3 dir="auto">Which project did you use? Sharding-JDBC or Sharding-Proxy?</h3>
<p dir="auto">Sharding-JDBC</p>
<h3 dir="auto">Expected behavior</h3>
<p dir="auto">sql execute success</p>
<h3 dir="auto">Actual behavior</h3>
<p dir="auto">Caused by: java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer</p>
<h3 dir="auto">Reason analyze (If you can)</h3>
<p dir="auto">my code below:<br>
public List findUsersByPageIntType(Integer begin, Integer end){<br>
String sql = "select id,name,age,email from user limit ?,? ";<br>
Object[] params = new Object[] {begin, end};<br>
List userList = jdbcTemplate.query(sql, params, getUserMapper());<br>
return userList;<br>
}<br>
public List findUsersByPageLongType(Long begin, Long end){<br>
String sql = "select id,name,age,email from user limit ?,? ";<br>
Object[] params = new Object[] {begin, end};<br>
List userList = jdbcTemplate.query(sql, params, getUserMapper());<br>
return userList;<br>
}</p>
<p dir="auto">first, call findUsersByPageIntType method, it's ok<br>
but call findUsersByPageLongType method there was an error -&gt; Caused by: java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer</p>
<h3 dir="auto">Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.</h3>
<p dir="auto">1.application.properties<br>
spring.shardingsphere.datasource.names=ds0<br>
spring.shardingsphere.datasource.ds0.type=com.zaxxer.hikari.HikariDataSource<br>
spring.shardingsphere.datasource.ds0.driver-class-name=com.mysql.jdbc.Driver<br>
spring.shardingsphere.datasource.ds0.jdbc-url=jdbc:mysql://127.0.0.1:3306/ttx_util?useUnicode=true&amp;useSSL=false&amp;characterEncoding=utf8<br>
spring.shardingsphere.datasource.ds0.username=test<br>
spring.shardingsphere.datasource.ds0.password=test</p>
<p dir="auto">spring.shardingsphere.sharding.tables.user.actual-data-nodes=ds0.user_$-&gt;{0..1}<br>
spring.shardingsphere.sharding.tables.user.table-strategy.inline.sharding-column=erp_id<br>
spring.shardingsphere.sharding.tables.user.table-strategy.inline.algorithm-expression=user_$-&gt;{erp_id % 2}<br>
spring.shardingsphere.sharding.tables.user.key-generator.column=id<br>
spring.shardingsphere.sharding.tables.user.key-generator.type=SNOWFLAKE<br>
#是否开启SQL显示，默认值: false<br>
spring.shardingsphere.props.sql.show=true<br>
2.table create sql:<br>
CREATE TABLE <code class="notranslate">user_0</code> (<br>
<code class="notranslate">id</code> bigint(20) NOT NULL COMMENT '主键ID',<br>
<code class="notranslate">erp_id</code> int(11) NOT NULL COMMENT '分表erpId',<br>
<code class="notranslate">name</code> varchar(30) DEFAULT NULL COMMENT '姓名',<br>
<code class="notranslate">age</code> int(11) DEFAULT NULL COMMENT '年龄',<br>
<code class="notranslate">email</code> varchar(50) DEFAULT NULL COMMENT '邮箱',<br>
PRIMARY KEY (<code class="notranslate">id</code>)<br>
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;</p>
<p dir="auto">CREATE TABLE <code class="notranslate">user_1</code> (<br>
<code class="notranslate">id</code> bigint(20) NOT NULL COMMENT '主键ID',<br>
<code class="notranslate">erp_id</code> int(11) NOT NULL COMMENT '分表erpId',<br>
<code class="notranslate">name</code> varchar(30) DEFAULT NULL COMMENT '姓名',<br>
<code class="notranslate">age</code> int(11) DEFAULT NULL COMMENT '年龄',<br>
<code class="notranslate">email</code> varchar(50) DEFAULT NULL COMMENT '邮箱',<br>
PRIMARY KEY (<code class="notranslate">id</code>)<br>
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;</p>
<h3 dir="auto">Example codes for reproduce this issue (such as a github link).</h3>