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

[GitHub] [shardingsphere] xuschang opened a new issue, #27878: ShardingSphere-jdbc:5.4.0 Cause: java.sql.SQLFeatureNotSupportedException: Can not get index from column label `COUNT(*)`.; Can not get index from column label `COUNT(*)`

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

   ## Bug Report
   ShardingSphere-JDBC:5.4.0 
   
   When using Oracle as a shardingDataSource, MyBatis will convert the selectCount statement to SELECT COUNT( * ) for execution. ColumnLabelAndIndexMap in ShardingResultSet stores the original column name and index value, which is [COUNT( * ),index]. However, Oracle returns the column name as COUNT(*), causing an error when retrieving the index.
   
   Related error
   
   Error attempting to get column 'COUNT(*)' from result set.  Cause: java.sql.SQLFeatureNotSupportedException: Can not get index from column label `COUNT(*)`.\n; Can not get index from column label `COUNT(*)`.; nested exception is java.sql.SQLFeatureNotSupportedException: Can not get index from column label `COUNT(*)`.
   
   
   The relevant code is as follows
   ![image](https://github.com/apache/shardingsphere/assets/19425207/fef8e053-0dc1-4e31-8f25-235d82399404)
   ![image](https://github.com/apache/shardingsphere/assets/19425207/fed60ed8-31b7-4fff-a100-63fa6c2f844e)


-- 
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] ShardingSphere-jdbc:5.4.0 Can not get index from column label COUNT( * ) [shardingsphere]

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

   Recently, I encountered this issue as well. I would like to know how you guys deal with it? Previously, I used MySQL, but now my database is HighGo. MySQL is correct ,but HighGo is wrong.  huh...


-- 
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] github-actions[bot] commented on issue #27878: ShardingSphere-jdbc:5.4.0 Can not get index from column label COUNT( * )

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #27878:
URL: https://github.com/apache/shardingsphere/issues/27878#issuecomment-1721782151

   There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.


-- 
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] strongduanmu commented on issue #27878: ShardingSphere-jdbc:5.4.0 Can not get index from column label COUNT( * )

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

   @xuschang Please modify this issue accord to bug template.


-- 
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] strongduanmu commented on issue #27878: ShardingSphere-jdbc:5.4.0 Can not get index from column label COUNT( * )

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

   @xuschang Can you try master branch? Or add alias for COUNT(*)


-- 
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] xuschang commented on issue #27878: ShardingSphere-jdbc:5.4.0 Can not get index from column label COUNT( * )

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

   > @xuschang Can you try master branch? Or add alias for COUNT(*)
    alias can work.
    But the SQL query "select count( * ) from table" is generated by MyBatis queryCount.
    just like
    ```
     QueryWrapper wrapper = new QueryWrapper<>();
    Integer countResult = mapper.selectCount(wrapper);
    ```
   


-- 
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] 51170526 commented on issue #27878: ShardingSphere-jdbc:5.4.0 Can not get index from column label COUNT( * )

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

   > > @xuschang Can you try master branch? Or add alias for COUNT(*)
   > > alias can work.
   > > But the SQL query "select count( * ) from table" is generated by MyBatis queryCount.
   > > just like
   > 
   > ```
   >  QueryWrapper wrapper = new QueryWrapper<>();
   > Integer countResult = mapper.selectCount(wrapper);
   > ```
   
   i have same question, and try alias for count
   occur exception code:
   conn.prepareStatement("select count(*) as total from test where import_date='202307'");
   
   actual sql
   select count(*) as total from test_202307_00 where import_date='202307' UNION ALL select count(*) as total from test_202307_01 where import_date='202307' UNION ALL select count(*) as total from test_202307_02 where import_date='202307'
   


-- 
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] ShardingSphere-jdbc:5.4.0 Can not get index from column label COUNT( * ) [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu closed issue #27878: ShardingSphere-jdbc:5.4.0  Can not get index from column label COUNT( * )
URL: https://github.com/apache/shardingsphere/issues/27878


-- 
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] azexcy commented on issue #27878: ShardingSphere-jdbc:5.4.0 Can not get index from column label COUNT( * )

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

   Hi @tuichenchuxin ,could you help to look at this 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


[GitHub] [shardingsphere] xuschang commented on issue #27878: ShardingSphere-jdbc:5.4.0 Can not get index from column label COUNT( * )

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

   > @xuschang Please modify this issue accord to bug template.
   
   done


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