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 2021/01/14 13:59:33 UTC

[GitHub] [shardingsphere] xiaobaojiang opened a new issue #9035: MemoryMergedResult SQLFeatureNotSupportedException: null

xiaobaojiang opened a new issue #9035:
URL: https://github.com/apache/shardingsphere/issues/9035


   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   sharding-core-merge-4.0.0-RC1
   ![image](https://user-images.githubusercontent.com/16165731/104599003-34817980-56b2-11eb-8e52-ee4726bd691e.png)
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-JDBC
   ### Expected behavior
   
   ### Actual behavior
   ```
   Caused by: java.sql.SQLFeatureNotSupportedException: null
   	at org.apache.shardingsphere.core.merge.dql.common.MemoryMergedResult.getValue(MemoryMergedResult.java:68)
   	at org.apache.shardingsphere.shardingjdbc.jdbc.core.resultset.ShardingResultSet.getClob(ShardingResultSet.java:295)
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   	at java.lang.reflect.Method.invoke(Method.java:498)
   	at org.apache.ibatis.logging.jdbc.ResultSetLogger.invoke(ResultSetLogger.java:68)
   	at com.sun.proxy.$Proxy161.getClob(Unknown Source)
   	at org.apache.ibatis.type.ClobTypeHandler.getNullableResult(ClobTypeHandler.java:41)
   	at org.apache.ibatis.type.ClobTypeHandler.getNullableResult(ClobTypeHandler.java:28)
   	at org.apache.ibatis.type.BaseTypeHandler.getResult(BaseTypeHandler.java:66)
   	at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.applyAutomaticMappings(DefaultResultSetHandler.java:520)
   	at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.getRowValue(DefaultResultSetHandler.java:401)
   	at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleRowValuesForSimpleResultMap(DefaultResultSetHandler.java:355)
   	at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleRowValues(DefaultResultSetHandler.java:330)
   	at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleResultSet(DefaultResultSetHandler.java:303)
   	at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleResultSets(DefaultResultSetHandler.java:196)
   	at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64)
   	at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79)
   	at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:63)
   	at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:326)
   	at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)
   	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)
   	at com.github.pagehelper.PageInterceptor.intercept(PageInterceptor.java:143)
   	at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61)
   	at com.sun.proxy.$Proxy159.query(Unknown Source)
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148)
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   	at java.lang.reflect.Method.invoke(Method.java:498)
   	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433)
   	... 139 common frames omitted
   ```
   ### Reason analyze (If you can)
   
   1. database: set column col1 type to varchar(40);
   2. jdbc connector: column co1 jdbctype is Clob.class
   3. getValue fail. throw new SQLFeatureNotSupportedException. 
   class: `org.apache.shardingsphere.core.merge.dql.common.MemoryMergedResult.getValue`
   ```
      @Override
       public final Object getValue(final String columnLabel, final Class<?> type) throws SQLException {
           if (Blob.class == type || Clob.class == type || Reader.class == type || InputStream.class == type || SQLXML.class == type) {
               throw new SQLFeatureNotSupportedException();
           }
           Object result = currentResultSetRow.getCell(labelAndIndexMap.containsKey(columnLabel) ? labelAndIndexMap.get(columnLabel) : labelAndIndexMap.get(SQLUtil.getExactlyValue(columnLabel)));
           wasNull = null == result;
           return result;
       }
   ```
   ![image](https://user-images.githubusercontent.com/16165731/104599256-7f9b8c80-56b2-11eb-8ad9-80f22482880c.png)
   
   ### 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.

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



[GitHub] [shardingsphere] xiaobaojiang commented on issue #9035: MemoryMergedResult SQLFeatureNotSupportedException: null

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


   resolve:  mapper.xml Specify col jdbctype
   


----------------------------------------------------------------
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] xiaobaojiang closed issue #9035: MemoryMergedResult SQLFeatureNotSupportedException: null

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


   


----------------------------------------------------------------
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] xiaobaojiang closed issue #9035: MemoryMergedResult SQLFeatureNotSupportedException: null

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


   


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