You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "Library-cll (via GitHub)" <gi...@apache.org> on 2024/12/04 03:54:08 UTC

[I] A field of type tiny(1) in the table, and SQL execution will return an SQLFeatureNotSupportedException. [shardingsphere]

Library-cll opened a new issue, #33911:
URL: https://github.com/apache/shardingsphere/issues/33911

   ## Bug Report
   There is the following msql table
   ```sql
   CREATE TABLE IF NOT EXISTS t_data
   (
       `id`              BIGINT         NOT NULL,
       `result`        TINYINT(1)       NULL     DEFAULT NULL
   )   ENGINE = InnoDB
   ```
   
   Use ShardingSphere-JDBCto execute the following sql
   
   ```
   SELECT * FROM t_data;
   ```
   The following exception will occur
   
   ```
   java.lang.ClassCastException: Cannot cast java.lang.Boolean to int 
   	at java.base/java.lang.Class.cast(Class.java:3890)
   	at org.apache.shardingsphere.infra.executor.sql.execute.result.query.impl.driver.jdbc.type.util.ResultSetUtils.convertValue(ResultSetUtils.java:89)
   	at org.apache.shardingsphere.driver.jdbc.core.resultset.ShardingSphereResultSet.getInt(ShardingSphereResultSet.java:123)
   	at org.apache.shardingsphere.driver.jdbc.core.resultset.ShardingSphereResultSet.getInt(ShardingSphereResultSet.java:128)
   	at com.huawei.ivcs.common.serialize.enums.HasValueEnumTypeHandler.getNullableResult(HasValueEnumTypeHandler.java:64)
   	at com.huawei.ivcs.common.serialize.enums.HasValueEnumTypeHandler.getNullableResult(HasValueEnumTypeHandler.java:24)
   	at org.apache.ibatis.type.BaseTypeHandler.getResult(BaseTypeHandler.java:86)
   	at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.getPropertyMappingValue(DefaultResultSetHandler.java:530)
   	at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.applyPropertyMappings(DefaultResultSetHandler.java:495)
   	at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.getRowValue(DefaultResultSetHandler.java:418)
   	at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleRowValuesForSimpleResultMap(DefaultResultSetHandler.java:366)
   	at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleRowValues(DefaultResultSetHandler.java:337)
   	at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleResultSet(DefaultResultSetHandler.java:310)
   	at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleResultSets(DefaultResultSetHandler.java:202)
   	at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:66)
   	at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:80)
   	at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:65)
   	at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:336)
   	at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:158)
   	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:110)
   ```
   
   
   Which version of ShardingSphere did you use?
   ShardingSphere-JDBC 5.5.0
   
   Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-JDBC 5.5.0
   
   ### Expected behavior
   
   ### Actual behavior
   
   ### Reason analyze (If you can)
   
   The org.mariadb.jdbc.client.column.SignedTinyIntColumn#defaultClassname method determines the special treatment of tiny(1) and treats it as a Boolean type
   
   ```
       public String defaultClassname(Configuration conf) {
           return conf.tinyInt1isBit() && this.columnLength == 1L ? Boolean.class.getName() : Integer.class.getName();
       }
   ```
   
   ### 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).
   


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] A field of type tiny(1) in the table, and SQL execution will return an SQLFeatureNotSupportedException. [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu commented on issue #33911:
URL: https://github.com/apache/shardingsphere/issues/33911#issuecomment-2517321815

   The issue involves other third-party dependencies, but our focus is solely on ShardingSphere itself. Since ShardingSphere implements the JDBC interface, standard applications should be functional. We wish to allocate more effort towards enhancing the current version, and therefore will no longer handle such issues. Please read the documentation or provide more effective information when submitting an issue.


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] A field of type tiny(1) in the table, and SQL execution will return an SQLFeatureNotSupportedException. [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu closed issue #33911: A field of type tiny(1) in the table, and SQL execution will return an SQLFeatureNotSupportedException.
URL: https://github.com/apache/shardingsphere/issues/33911


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org