Changeset: ead1e2780a68 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/ead1e2780a68
Modified Files:
        monetdb5/mal/mal_pipelines.c
        sql/backends/monet5/copy.c
Branch: default
Log Message:

make sure the oldest pipeline task is started.


diffs (45 lines):

diff --git a/monetdb5/mal/mal_pipelines.c b/monetdb5/mal/mal_pipelines.c
--- a/monetdb5/mal/mal_pipelines.c
+++ b/monetdb5/mal/mal_pipelines.c
@@ -104,12 +104,9 @@ q_dequeue(Queue *q)
                return NULL;
        MT_lock_set(&q->l);
        {
-               int i = q->last - 1;
-
-               r = q->data[i];
-               assert (i >= 0);
+               r = q->data[0];
                q->last--;
-               memmove(q->data + i, q->data + i + 1, (q->last - i) * 
sizeof(q->data[0]));
+               memmove(q->data, q->data + 1, (q->last) * sizeof(q->data[0]));
        }
        MT_lock_unset(&q->l);
        return r;
diff --git a/sql/backends/monet5/copy.c b/sql/backends/monet5/copy.c
--- a/sql/backends/monet5/copy.c
+++ b/sql/backends/monet5/copy.c
@@ -551,7 +551,10 @@ COPYsplitlines(Client cntxt, MalBlkPtr m
                p->p->master_counter = (p->p->nr_workers*-2);
 
        if (!r->done && !r->error)
-               (void)pipeline_get_token(p, 0, p->wid, &r->done);
+               if (pipeline_get_token(p, 0, p->wid, &r->done) < 0) {
+                       r->error = true;
+                       goto end;
+               }
 
        if (!r->done)
                p->seqnr = (int)r->bs->seq[p->wid];
@@ -597,7 +600,10 @@ COPYsplitlines(Client cntxt, MalBlkPtr m
                        goto end;
                }
                if (r->can_jump)
-                       (void)pipeline_get_token(p, 1, p->wid, &r->done);
+                       if (pipeline_get_token(p, 1, p->wid, &r->done) < 0) {
+                               r->error = true;
+                               goto end;
+                       }
                r->linecount += line_count;
                state.end = state.start + e;
                if (e)
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to