Changeset: 42bde329ac0f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/42bde329ac0f
Modified Files:
        sql/server/rel_distribute.c
Branch: default
Log Message:

Fixes bug for case of REMOTE tree with only replicas


diffs (25 lines):

diff --git a/sql/server/rel_distribute.c b/sql/server/rel_distribute.c
--- a/sql/server/rel_distribute.c
+++ b/sql/server/rel_distribute.c
@@ -140,8 +140,21 @@ replica_rewrite(visitor *v, sql_table *t
 
                        for (node *m = uris->h; m && !res; m = m->next) {
                                if (strcmp(((tid_uri*)m->data)->uri, pt->query) 
== 0) {
+                                       /* we found a matching uri do the 
actual rewrite */
                                        res = do_replica_rewrite(v->sql, exps, 
t, pt,
                                                                         
rpstate->no_rmt_branch_rpl_leaf ? true: false);
+                                       /* set to the REMOTE a list with a 
single uri (the matching one)
+                                        * this is for the case that our REMOTE 
subtree has only replicas
+                                        * with multiple remotes*/
+                                       if (list_length(rp->value.pval) > 1) {
+                                               list *uri = sa_list(v->sql->sa);
+                                               tid_uri *tu = 
SA_NEW(v->sql->sa, tid_uri);
+                                               tu->id = 0;
+                                               tu->uri = pt->query;
+                                               append(uri, tu);
+                                               rp->value.pval = uri;
+                                               break;
+                                       }
                                }
                        }
                }
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to