terrymanu commented on a change in pull request #8928:
URL: https://github.com/apache/shardingsphere/pull/8928#discussion_r554704956
##########
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 ProxyContext is public class which is in
shardingsphere-proxy-backend module.
The database dialect should in their own module, it is better to keep public
modules independent, and let them do not know database dialect details.
----------------------------------------------------------------
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]