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/10/31 03:43:02 UTC

[GitHub] [incubator-shardingsphere] beijing-penguin commented on a change in pull request #3414: Fix jdbc getIndexInfo method and NullPointerException on oracle

beijing-penguin commented on a change in pull request #3414: Fix jdbc getIndexInfo method and NullPointerException on oracle
URL: https://github.com/apache/incubator-shardingsphere/pull/3414#discussion_r340949410
 
 

 ##########
 File path: sharding-core/sharding-core-execute/src/main/java/org/apache/shardingsphere/core/execute/metadata/TableMetaDataLoader.java
 ##########
 @@ -199,7 +199,7 @@ private boolean isTableExist(final Connection connection, final String catalog,
     
     private Collection<String> getLogicIndexes(final Connection connection, final String catalog, final String actualTableName) throws SQLException {
         Collection<String> result = new HashSet<>();
-        try (ResultSet resultSet = connection.getMetaData().getIndexInfo(catalog, catalog, actualTableName, false, false)) {
+        try (ResultSet resultSet = connection.getMetaData().getIndexInfo(catalog, null, actualTableName, false, false)) {
 
 Review comment:
   I read mysql-connector-java-5.1.48.java and ojdbc8.jar and postresql-42.2.8.jar,the result is
   1.mysql is not using the  getIndexInfo's second parameter
   2.oracle is using second parameter as owner,like this "select * from all_tables where owner=?"
   3.postresql is using second parameter as tablespace_name,like this
   ```
   if (schema != null && !schema.isEmpty()) {
           sql += " AND n.nspname = " + escapeQuotes(schema);
   }
   ```
   so i think that 
   1.if use mysql ,the second parameter is null
   2.if use oracle that the second parameter is username
   3.if use postresql that the second parameter is nspname (tablespace_name)
   
    

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