wy1433 commented on code in PR #35022:
URL: https://github.com/apache/shardingsphere/pull/35022#discussion_r2000572129


##########
infra/database/type/opengauss/src/main/java/org/apache/shardingsphere/infra/database/opengauss/metadata/data/loader/OpenGaussMetaDataLoader.java:
##########
@@ -70,7 +72,10 @@ public final class OpenGaussMetaDataLoader implements 
DialectMetaDataLoader {
     @Override
     public Collection<SchemaMetaData> load(final MetaDataLoaderMaterial 
material) throws SQLException {
         try (Connection connection = material.getDataSource().getConnection()) 
{
-            Collection<String> schemaNames = 
SchemaMetaDataLoader.loadSchemaNames(connection, 
TypedSPILoader.getService(DatabaseType.class, "openGauss"));
+            DatabaseType databaseType = 
TypedSPILoader.getService(DatabaseType.class, "openGauss");
+            DialectDatabaseMetaData dialectDatabaseMetaData = new 
DatabaseTypeRegistry(databaseType).getDialectDatabaseMetaData();
+            dialectDatabaseMetaData.getSchema(connection);

Review Comment:
   the method getSchema() is overrided in Class OpenGaussDatabaseMetaData, 
which will set defaultSchema first.
   the code like this:
   ```
       @Override
       public String getSchema(final Connection connection) {
           this.defaultSchema = 
DialectDatabaseMetaData.super.getSchema(connection);
           return this.defaultSchema;
       }
   ```



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

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to