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

add back projection into stmt_uselect and stmt_uselect2, ie get the right oid's 
again


diffs (85 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
@@ -1488,6 +1488,7 @@ stmt_uselect(backend *be, stmt *op1, stm
                default:
                        TRC_ERROR(SQL_EXECUTION, "Unknown operator\n");
                }
+               int pushed = 0;
 
                if ((q = multiplex2(mb, mod, convertOperator(op), l, r, 
TYPE_bit)) == NULL)
                        return NULL;
@@ -1500,6 +1501,7 @@ stmt_uselect(backend *be, stmt *op1, stm
                                q = pushNil(mb, q, TYPE_bat);
                        else if (op2->nrcols)
                                q = pushArgument(mb, q, sel->nr);
+                       pushed = 1;
                }
                if (is_semantics)
                        q = pushBit(mb, q, TRUE);
@@ -1507,6 +1509,8 @@ stmt_uselect(backend *be, stmt *op1, stm
 
                q = newStmtArgs(mb, algebraRef, selectRef, 9);
                q = pushArgument(mb, q, k);
+               if (sel && !pushed)
+                       pushArgument(mb, q, sel->nr);
                q = pushBit(mb, q, !need_not);
                q = pushBit(mb, q, !need_not);
                q = pushBit(mb, q, TRUE);
@@ -1514,6 +1518,12 @@ stmt_uselect(backend *be, stmt *op1, stm
                q = pushBit(mb, q, anti);
                if (q == NULL)
                        return NULL;
+               if (sel && pushed) { /* get back too the correct ids */
+                       int nr = getDestVar(q);
+                       q = newStmt(mb, algebraRef, projectionRef);
+                       q = pushArgument(mb, q, nr);
+                       q = pushArgument(mb, q, sel->nr);
+               }
                k = getDestVar(q);
        } else {
                assert (cmptype != cmp_filter);
@@ -1533,12 +1543,15 @@ stmt_uselect(backend *be, stmt *op1, stm
                        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 */
                                q = pushArgument(mb, q, sel->nr);
-                       else
+                       else {
                                q = pushNil(mb, q, TYPE_bat);
+                               pushed = 1;
+                       }
                        q = pushArgument(mb, q, r);
                        switch (cmptype) {
                        case mark_in:
@@ -1567,6 +1580,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 == NULL)
                        return NULL;
@@ -1659,6 +1678,13 @@ select2_join2(backend *be, stmt *op1, st
                q = pushBit(mb, q, TRUE);
                q = pushBit(mb, q, TRUE);
                q = pushBit(mb, q, FALSE);
+               /* project */
+               if (sel && pushed) { /* get back too the correct ids */
+                       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;
        } else {
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to