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 2020/11/05 06:07:51 UTC

[GitHub] [shardingsphere] nnxiaod opened a new issue #8034: ClassCastException. parameter corresponding to the built-in function field

nnxiaod opened a new issue #8034:
URL: https://github.com/apache/shardingsphere/issues/8034


   ### Which version of ShardingSphere did you use?
   4.1.1
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   sharding-jdbc
   
   ### Expected behavior
   correct pagination
   
   ### Actual behavior
   Exception:cannot cast String to Integer
   
   ### Example codes for reproduce this issue (such as a github link).
   
   I found this when I was debugging
   
   
   parameters(ArrayList):
   ```
   0-"BBB"
   1-"2020-10-28"
   2-0
   3-2
   ```
   
   SQL-1
   ```
   select * from test_table where code = #{code} and join_time >= #{joinDate} limit #{startRow}, #{pageSize}
   ```
   SelectStatement -> LimitStatement -> offset -> paramterIndex -> 2
   SelectStatement -> LimitStatement -> rowCount -> paramterIndex -> 3
   
   SQL-2
   ```
   select * from test_table where code = #{code} and date(join_time) = #{joinDate} limit #{startRow}, #{pageSize}
   ```
   SelectStatement -> LimitStatement -> offset -> paramterIndex -> 1
   SelectStatement -> LimitStatement -> rowCount -> paramterIndex -> 2
   
   The difference is that the second SQL uses the built-in function ```date```
   It does not recognize the parameter corresponding to the built-in function field, which causes the parameter to not map correctly.
   It tries to convert 2020-10-28 to an integer and then throws a ClassCastException
   


----------------------------------------------------------------
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



[GitHub] [shardingsphere] tristaZero commented on issue #8034: ClassCastException. parameter corresponding to the built-in function field

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #8034:
URL: https://github.com/apache/shardingsphere/issues/8034#issuecomment-722781796


   Hi @nnxiaod I suppose we fixed in the coming release 5.0.0-alpha.
   @jingshanglu Could you give it a double-check?


----------------------------------------------------------------
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



[GitHub] [shardingsphere] tristaZero closed issue #8034: ClassCastException. parameter corresponding to the built-in function field

Posted by GitBox <gi...@apache.org>.
tristaZero closed issue #8034:
URL: https://github.com/apache/shardingsphere/issues/8034


   


----------------------------------------------------------------
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



[GitHub] [shardingsphere] jingshanglu commented on issue #8034: ClassCastException. parameter corresponding to the built-in function field

Posted by GitBox <gi...@apache.org>.
jingshanglu commented on issue #8034:
URL: https://github.com/apache/shardingsphere/issues/8034#issuecomment-723756539


   @tristaZero @nnxiaod  I have checked it ,it is ok on  release `5.0.0-alpha`.


----------------------------------------------------------------
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



[GitHub] [shardingsphere] tristaZero commented on issue #8034: ClassCastException. parameter corresponding to the built-in function field

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #8034:
URL: https://github.com/apache/shardingsphere/issues/8034#issuecomment-724433282


   Nice :) @jingshanglu 


----------------------------------------------------------------
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