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/07/08 05:20:19 UTC

[GitHub] [incubator-shardingsphere] sunbufu commented on a change in pull request #2668: add `getValueByColumnType` method

sunbufu commented on a change in pull request #2668: add `getValueByColumnType` method
URL: https://github.com/apache/incubator-shardingsphere/pull/2668#discussion_r300924997
 
 

 ##########
 File path: sharding-core/sharding-core-execute/src/main/java/org/apache/shardingsphere/core/execute/sql/execute/result/StreamQueryResult.java
 ##########
 @@ -68,12 +68,12 @@ public boolean next() throws SQLException {
     
     @Override
     public Object getValue(final int columnIndex, final Class<?> type) throws SQLException {
-        return decrypt(columnIndex, QueryResultUtil.getValue(resultSet, columnIndex));
+        return decrypt(columnIndex, QueryResultUtil.getValue(resultSet, columnIndex, type));
 
 Review comment:
   > StreamQueryResult pass the type to getValue(), but what about MemoryQueryResult?
   
   This is why i doesn't deleted `QueryResultUtil.getValueByColumnType()`, I have overload a `getValue()` method with `Class<?> type` in `QueryResultUtil`,  `StreamQueryResult` will call the new `getValue` with `Class<?> type`, and `MemoryQueryResult ` will continue to call the old `getValue()`.
   ![image](https://user-images.githubusercontent.com/14866067/60784761-c685f900-a182-11e9-8ef7-31371658c823.png)
   ![image](https://user-images.githubusercontent.com/14866067/60784778-d1408e00-a182-11e9-8229-452a004fb6e0.png)
   
   

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