Changeset: 7f72677083a9 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/7f72677083a9
Modified Files:
        monetdb5/mal/mal_profiler.c
        monetdb5/optimizer/opt_pipes.c
        sql/backends/monet5/sql_statement.c
        sql/test/Tests/setoptimizer.test
Branch: default
Log Message:

merged with jul2021


diffs (47 lines):

diff --git a/sql/backends/monet5/sql_statement.c 
b/sql/backends/monet5/sql_statement.c
--- a/sql/backends/monet5/sql_statement.c
+++ b/sql/backends/monet5/sql_statement.c
@@ -3962,7 +3962,8 @@ stmt_cond(backend *be, stmt *cond, stmt 
                        freeInstruction(q);
                        return NULL;
                }
-               s->flag = loop;
+               s->flag = be->mvc_var; /* keep the mvc_var of the outer context 
*/
+               s->loop = loop;
                s->op1 = cond;
                s->nr = getArg(q, 0);
                return s;
@@ -3979,7 +3980,7 @@ stmt_control_end(backend *be, stmt *cond
        if (cond->nr < 0)
                return NULL;
 
-       if (cond->flag) {       /* while */
+       if (cond->loop) {       /* while */
                /* redo barrier */
                q = newAssignment(mb);
                if (q == NULL)
@@ -3998,10 +3999,7 @@ stmt_control_end(backend *be, stmt *cond
                q->argc = q->retc = 1;
                q->barrier = EXITsymbol;
        }
-       q = newStmt(mb, sqlRef, mvcRef);
-       if (q == NULL)
-               return NULL;
-       be->mvc_var = getDestVar(q);
+       be->mvc_var = cond->flag; /* restore old mvc_var from before the 
barrier */
        stmt *s = stmt_create(be->mvc->sa, st_control_end);
        if(!s) {
                freeInstruction(q);
diff --git a/sql/backends/monet5/sql_statement.h 
b/sql/backends/monet5/sql_statement.h
--- a/sql/backends/monet5/sql_statement.h
+++ b/sql/backends/monet5/sql_statement.h
@@ -119,7 +119,8 @@ typedef struct stmt {
         key:1,                 /* key (aka all values are unique) */ // TODO 
make this thing a bool
         aggr:1,                /* aggregated */
         partition:1,   /* selected as mitosis candidate */
-        reduce:1;              /* used to reduce number of rows (also for 
joins) */
+        reduce:1,              /* used to reduce number of rows (also for 
joins) */
+        loop:1;                /* cond statement is looping */
 
        struct stmt *cand;      /* optional candidate list */
 
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to