tigerxn commented on a change in pull request #8928:
URL: https://github.com/apache/shardingsphere/pull/8928#discussion_r554765433



##########
File path: 
shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/context/ProxyContext.java
##########
@@ -115,7 +116,13 @@ public ShardingSphereMetaData getMetaData(final String 
schemaName) {
         if (schemaNames.isEmpty()) {
             return Optional.empty();
         }
-        Map<String, DataSource> dataSources = 
getMetaData(schemaNames.get(0)).getResource().getDataSources();
-        return dataSources.values().stream().findFirst();
+        for (String schemaName : schemaNames) {
+            ShardingSphereResource shardingSphereResource = 
getMetaData(schemaName).getResource();
+            DatabaseType databaseType = 
shardingSphereResource.getDatabaseType();
+            if ("MySQL".equals(databaseType.getName())) {
+                return 
shardingSphereResource.getDataSources().values().stream().findFirst();
+            }

Review comment:
       This method(getDataSourceSample) is moved from ProxyContext  to 
AbstractBootstrapInitializer ,and changed to private
   method,only used by setDatabaseServerInfo。
   




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