tigerxn commented on a change in pull request #8928:
URL: https://github.com/apache/shardingsphere/pull/8928#discussion_r554015311
##########
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:
The method(getDataSourceSample) name can be changed。
----------------------------------------------------------------
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]