iblilife edited a comment on issue #8605:
URL: https://github.com/apache/shardingsphere/issues/8605#issuecomment-750872836


   @tristaZero @huanghao495430759 
   
   My English Very Poor!Help me fixed this bug,thx!Orz...
   
   I found the cause of the bug。
   
   java: 
org.apache.shardingsphere.infra.metadata.model.logic.LogicSchemaMetaDataLoader
   
   
`org.apache.shardingsphere.infra.metadata.model.logic.LogicSchemaMetaDataLoader#load(org.apache.shardingsphere.infra.database.type.DatabaseType,
 java.util.Map<java.lang.String,javax.sql.DataSource>, 
org.apache.shardingsphere.infra.config.properties.ConfigurationProperties)
   ` 
   Not init unconfigured tables `SchemaMetaData`
   
   Cause 
`org.apache.shardingsphere.driver.jdbc.core.resultset.ShardingSphereResultSetMetaData#getColumnCount`
 to get wrong data
   
   ```java
       public LogicSchemaMetaData load(final DatabaseType databaseType, final 
Map<String, DataSource> dataSourceMap,
                                       final ConfigurationProperties props) 
throws SQLException {
           Collection<String> excludedTableNames = new 
TreeSet<>(String.CASE_INSENSITIVE_ORDER);
           PhysicalSchemaMetaData configuredSchemaMetaData = new 
PhysicalSchemaMetaData();
           for (Entry<ShardingSphereRule, LogicMetaDataLoader> entry : 
OrderedSPIRegistry.getRegisteredServices(rules, 
LogicMetaDataLoader.class).entrySet()) {
               PhysicalSchemaMetaData schemaMetaData = 
entry.getValue().load(databaseType, dataSourceMap, new DataNodes(rules), 
entry.getKey(), props, excludedTableNames);
               excludedTableNames.addAll(schemaMetaData.getAllTableNames());
               if (entry.getKey() instanceof DataNodeRoutedRule) {
                   excludedTableNames.addAll(((DataNodeRoutedRule) 
entry.getKey()).getAllActualTables());
               }
               configuredSchemaMetaData.merge(schemaMetaData);
           }
           decorate(configuredSchemaMetaData);
           Map<String, Collection<String>> unConfiguredSchemaMetaDataMap = 
loadUnConfiguredSchemaMetaData(databaseType, dataSourceMap, excludedTableNames);
           
/**********************************************************************
           //
           // Here should be initialized unconfigured tables SchemaMetaData
           // init table columns data
           **/
           return new LogicSchemaMetaData(configuredSchemaMetaData, 
unConfiguredSchemaMetaDataMap);
       }
   ```


----------------------------------------------------------------
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:
[email protected]


Reply via email to