You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2019/08/29 02:01:58 UTC

[GitHub] [incubator-shardingsphere] hqq2023623 commented on issue #2926: mysql page limit Long parameter type error

hqq2023623 commented on issue #2926: mysql page limit Long parameter type error
URL: https://github.com/apache/incubator-shardingsphere/issues/2926#issuecomment-525989983
 
 
   The code below shows that Long is not supported 
   May I ask why you need to use Long for limit ? 
   
   
   Code of org.apache.shardingsphere.core.optimize.sharding.segment.select.pagination.Pagination
   ```java
       private final int actualOffset;
       private final Integer actualRowCount;
       
       public Pagination(final PaginationValueSegment offsetSegment, final PaginationValueSegment rowCountSegment, final List<Object> parameters) {
           hasPagination = null != offsetSegment || null != rowCountSegment;
           this.offsetSegment = offsetSegment;
           this.rowCountSegment = rowCountSegment;
           actualOffset = null == offsetSegment ? 0 : getValue(offsetSegment, parameters);
           actualRowCount = null == rowCountSegment ? null : getValue(rowCountSegment, parameters); 
       }
   
       private int getValue(final PaginationValueSegment paginationValueSegment, final List<Object> parameters) {
           return paginationValueSegment instanceof ParameterMarkerPaginationValueSegment
                   ?
                   (int) parameters.get(((ParameterMarkerPaginationValueSegment) paginationValueSegment).getParameterIndex())
                   : ((NumberLiteralPaginationValueSegment) paginationValueSegment).getValue();
       }
   ```
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services