You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/01/08 10:58:39 UTC

[GitHub] [shardingsphere] terrymanu commented on a change in pull request #8928: 8927

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



##########
File path: shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/java/org/apache/shardingsphere/proxy/initializer/impl/AbstractBootstrapInitializer.java
##########
@@ -113,6 +113,8 @@ private void setDatabaseServerInfo() {
             DatabaseServerInfo databaseServerInfo = new DatabaseServerInfo(dataSourceSample.get());
             log.info(databaseServerInfo.toString());
             MySQLServerInfo.setServerVersion(databaseServerInfo.getDatabaseVersion());
+        } else {
+            MySQLServerInfo.setServerVersion(null);

Review comment:
       set null maybe unnecessary

##########
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 is the public module, we cannot consider about MySQL only.
   What is the behaviour of PostgreSQL?




----------------------------------------------------------------
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:
users@infra.apache.org