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 2020/05/06 10:33:11 UTC

[GitHub] [shardingsphere] terrymanu commented on a change in pull request #5436: fix TableMetaData load error when use oracle.

terrymanu commented on a change in pull request #5436:
URL: https://github.com/apache/shardingsphere/pull/5436#discussion_r420691585



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/main/java/org/apache/shardingsphere/sql/parser/binder/metadata/index/IndexMetaDataLoader.java
##########
@@ -47,6 +47,9 @@
         try (ResultSet resultSet = connection.getMetaData().getIndexInfo(connection.getCatalog(), connection.getSchema(), table, false, false)) {
             while (resultSet.next()) {
                 String indexName = resultSet.getString(INDEX_NAME);
+                if (null == indexName) {
+                    continue;
+                }
                 result.add(new IndexMetaData(indexName));

Review comment:
       It is better to:
   
   ```java
   if (null != indexName) {
       result.add(new IndexMetaData(indexName));
   }
   ```




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