shardingsphere icon indicating copy to clipboard operation
shardingsphere copied to clipboard

Bug Report, java.lang.ClassCastException.

Open HongJinFeng opened this issue 7 years ago • 2 comments

Bug Report

  1. Bug occur when jdbcType is tinyint(1) and java type is Integer, but sharding-jdbc convert the value to boolean.
  2. Here is the core position. org.apache.shardingsphere.shardingjdbc.jdbc.core.resultset.EncryptResultSet.getInt(final String columnLabel)

For English only, other languages will not accept.

Before report a bug, make sure you have:

Please pay attention on issues you submitted, because we maybe need more details. If no response more than 7 days and we cannot reproduce it on current information, we will close it.

Please answer these questions before submitting your issue. Thanks!

Which version of ShardingSphere did you use?

4.0.0-RC2

Which project did you use? Sharding-JDBC or Sharding-Proxy?

Sharding-JDBC

Expected behavior

Actual behavior

Reason analyze (If you can)

In MySql ,tinyInt(1) is same with boolean type, it probable sharding-sphere make an error value cover here.

Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.

Example codes for reproduce this issue (such as a github link).

HongJinFeng avatar Nov 06 '19 12:11 HongJinFeng

Seem 4.0.0-RC3 fixed it. #3311

yanickxia avatar Nov 06 '19 12:11 yanickxia

Got it. It worked after config my datasource url with 'tinyInt1isBit=false'. In addition, When 4.0.0-RC3 can be found in maven central repository?

HongJinFeng avatar Nov 07 '19 02:11 HongJinFeng