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/03/24 06:26:16 UTC

[GitHub] [shardingsphere] SammyXue opened a new issue #9800: create indexes repeatedly when set `hibernate.hbm2ddl.auto = update`

SammyXue opened a new issue #9800:
URL: https://github.com/apache/shardingsphere/issues/9800


   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more details. 
   If no response anymore and we cannot reproduce it on current information, we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   
   4.0.1
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   ShardingSphere-JDBC
   
   ### Expected behavior
   don't create indexes repeatedly
   ### Actual behavior
    i use hibernate and set `hibernate.hbm2ddl.auto = update` ,the program will create indexes repeatedly when the program restart.
   ### Reason analyze (If you can)
   
   org.apache.shardingsphere.shardingjdbc.jdbc.core.datasource.metadata.ResultSetReturnedDatabaseMetaData#getIndexInfo
   ```java
    @Override
       public final ResultSet getIndexInfo(final String catalog, final String schema, final String table, final boolean unique, final boolean approximate) throws SQLException {
           //i think the function "getActualTable" should have another param "catalog" to find the true  actualTable .
           //String actualTable = getActualTable(table);
           String actualTable = getActualTable(catalog, table);
           try (Connection connection = getConnection()) {
               return new DatabaseMetaDataResultSet(connection.getMetaData().getIndexInfo(catalog, schema, actualTable, unique, approximate), shardingRule);
           }
       }
   ```
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   Get the github link and run the program pls.
   ### Example codes for reproduce this issue (such as a github link).
   https://github.com/SammyXue/sharding-hibernate-demo


-- 
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] strongduanmu commented on issue #9800: create indexes repeatedly when set `hibernate.hbm2ddl.auto = update`

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


   @SammyXue Thank you very much for your feedback, I will investigate this issue later. 


-- 
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] terrymanu closed issue #9800: create indexes repeatedly when set `hibernate.hbm2ddl.auto = update`

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


   


-- 
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] strongduanmu commented on issue #9800: create indexes repeatedly when set `hibernate.hbm2ddl.auto = update`

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


   @SammyXue Sorry for the late reply. I have tested the demo that you provided, and as you said, this is an existing bug. I have submitted a PR to fix this problem, you can try the `5.0.0-alpha` version later.
   


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