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 2019/10/17 10:10:38 UTC

[GitHub] [incubator-shardingsphere] yanickxia commented on a change in pull request #3315: Add support show database

yanickxia commented on a change in pull request #3315: Add support show database
URL: https://github.com/apache/incubator-shardingsphere/pull/3315#discussion_r335921699
 
 

 ##########
 File path: sharding-core/sharding-core-merge/src/main/java/org/apache/shardingsphere/core/merge/dal/show/ShowDatabasesMergedResult.java
 ##########
 @@ -30,22 +31,42 @@
 import java.sql.SQLXML;
 import java.util.Collections;
 import java.util.List;
+import org.apache.shardingsphere.core.rule.ShardingRule;
 
 /**
  * Merged result for show databases.
  *
  * @author chenqingyang
  */
-@RequiredArgsConstructor
 public final class ShowDatabasesMergedResult extends LocalMergedResultAdapter implements MergedResult {
     
     private final List<String> schemas;
     
     private int currentIndex;
-    
+
     public ShowDatabasesMergedResult() {
         this(Collections.singletonList(ShardingConstant.LOGIC_SCHEMA_NAME));
     }
+
+    //for proxy backend, just return logic database
+    public ShowDatabasesMergedResult(final List<String> schemas) {
+        this.schemas = schemas;
+        this.currentIndex = 0;
+    }
+
+    public ShowDatabasesMergedResult(final ShardingRule shardingRule, final List<QueryResult> queryResults)throws SQLException {
+        this.schemas = new ArrayList<>();
 
 Review comment:
   this constructor not easy to arraylist, beacuse the QueryResult SPI not size() function. so i will refactor it..

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


With regards,
Apache Git Services