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 2022/11/02 09:04:01 UTC

[GitHub] [shardingsphere] kuchikij opened a new issue, #21906: java.sql.SQLException: Invalid column index: getValidColumnIndex

kuchikij opened a new issue, #21906:
URL: https://github.com/apache/shardingsphere/issues/21906

   ### Which version of ShardingSphere did you use?
   5.2.0
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-JDBC
   
   ### Expected behavior
   SQL query successfully in Oracle database.
   
   ### Actual behavior
   SQL query error in Oracle database. The following problems are encountered.
   java.sql.SQLException: Invalid column index: getValidColumnIndex
   	at oracle.jdbc.driver.OracleResultSetMetaData.getValidColumnIndex(OracleResultSetMetaData.java:102)
   	at oracle.jdbc.driver.OracleResultSetMetaData.getColumnName(OracleResultSetMetaData.java:267)
   	at oracle.jdbc.driver.OracleResultSetMetaData.getColumnLabel(OracleResultSetMetaData.java:256)
   	at org.apache.shardingsphere.driver.jdbc.core.resultset.ShardingSphereResultSetMetaData.getColumnLabel(ShardingSphereResultSetMetaData.java:106)
   	at org.springframework.jdbc.support.JdbcUtils.lookupColumnName(JdbcUtils.java:509)
   	at org.springframework.jdbc.core.BeanPropertyRowMapper.mapRow(BeanPropertyRowMapper.java:294)
   	at org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:94)
   	at org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:61)
   	at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:679)
   	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:617)
   	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:669)
   	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:694)
   	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:748)
   	at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.query(NamedParameterJdbcTemplate.java:216)
   	at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.query(NamedParameterJdbcTemplate.java:223)
   
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   The sql like following:
   ```sql
   select *
     from (select Res.*, rownum as rn
             from (SELECT a.*
                     FROM (select * from t_order where order_id = :order_id) a
                    inner join (select * from t_order_price) dr
                       on a.order_id = dr.order_id
                      and dr.price >= :price
                    ORDER BY a.create_date_time desc) Res
            where rownum <= ?)
    where rn > ?
   ```
   The subquery *select * from t_order_price* is used to filter data. It doesn't need to query field!
   
   ### 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


[GitHub] [shardingsphere] fang1025 commented on issue #21906: java.sql.SQLException: Invalid column index: getValidColumnIndex

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

   Try listing columns instead of a.*.
   a.* -> a.order_id, a.price...
   
   


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


[GitHub] [shardingsphere] kuchikij commented on issue #21906: java.sql.SQLException: Invalid column index: getValidColumnIndex

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

   > Hi @kuchikij Thanks for your feedback, are `t_order` and `t_order_price` sharding tables? what are their rules?
   
   @RaigorJiang I have added info to the above.


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


[GitHub] [shardingsphere] RaigorJiang commented on issue #21906: java.sql.SQLException: Invalid column index: getValidColumnIndex

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

   Hi @kuchikij 
   Thanks for your feedback, are `t_order` and `t_order_price`  sharding tables? what are their rules?


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


[GitHub] [shardingsphere] RaigorJiang closed issue #21906: java.sql.SQLException: Invalid column index: getValidColumnIndex

Posted by GitBox <gi...@apache.org>.
RaigorJiang closed issue #21906: java.sql.SQLException: Invalid column index: getValidColumnIndex
URL: https://github.com/apache/shardingsphere/issues/21906


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


[GitHub] [shardingsphere] RaigorJiang commented on issue #21906: java.sql.SQLException: Invalid column index: getValidColumnIndex

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

   Close because it has been resolved.


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


[GitHub] [shardingsphere] kuchikij commented on issue #21906: java.sql.SQLException: Invalid column index: getValidColumnIndex

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

   > ```
   > Try listing columns instead of a.*
   > a.* -> a.order_id, a.price...
   > ```
   
   It'a feasible! Thanks!


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