Changeset: 62a1b4e80bc8 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/62a1b4e80bc8
Modified Files:
        sql/backends/monet5/sql_statement.c
Branch: pushcands
Log Message:

small cleanup of pushed candidates handling


diffs (49 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
@@ -1554,6 +1554,7 @@ stmt_uselect(backend *be, stmt *op1, stm
                k = getDestVar(q);
        } else {
                assert (cmptype != cmp_filter);
+               int pushed = 0;
                if (is_semantics) {
                        assert(cmptype == cmp_equal || cmptype == cmp_notequal);
                        if (cmptype == cmp_notequal)
@@ -1562,15 +1563,16 @@ stmt_uselect(backend *be, stmt *op1, stm
                        q = pushArgument(mb, q, l);
                        if (!op1->cand && op1->nrcols && sel) /* don't push 
cands again */
                                q = pushArgument(mb, q, sel->nr);
-                       else
+                       else {
                                q = pushNil(mb, q, TYPE_bat);
+                               pushed = 1;
+                       }
                        q = pushArgument(mb, q, r);
                        q = pushArgument(mb, q, r);
                        q = pushBit(mb, q, TRUE);
                        q = pushBit(mb, q, TRUE);
                        q = pushBit(mb, q, anti);
                } else {
-                       int pushed = 0;
                        q = newStmt(mb, algebraRef, thetaselectRef);
                        q = pushArgument(mb, q, l);
                        if (!op1->cand && op1->nrcols && sel) /* don't push 
cands again */
@@ -1607,12 +1609,12 @@ stmt_uselect(backend *be, stmt *op1, stm
                                        freeInstruction(q);
                                q = NULL;
                        }
-                       if (sel && pushed) {
-                               int nr = getDestVar(q);
-                               q = newStmt(mb, algebraRef, projectionRef);
-                               q = pushArgument(mb, q, nr);
-                               q = pushArgument(mb, q, sel->nr);
-                       }
+               }
+               if (q && sel && pushed) {
+                       int nr = getDestVar(q);
+                       q = newStmt(mb, algebraRef, projectionRef);
+                       q = pushArgument(mb, q, nr);
+                       q = pushArgument(mb, q, sel->nr);
                }
                if (q == NULL)
                        return NULL;
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to