Changeset: 5b2be530b215 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5b2be530b215
Modified Files:
        MonetDB5/src/optimizer/opt_prelude.mx
Branch: default
Log Message:

Merge with Oct2010 branch.


diffs (97 lines):

diff -r 262dcfd586a9 -r 5b2be530b215 MonetDB5/src/optimizer/opt_mergetable.mx
--- a/MonetDB5/src/optimizer/opt_mergetable.mx  Thu Oct 28 15:33:06 2010 +0200
+++ b/MonetDB5/src/optimizer/opt_mergetable.mx  Thu Oct 28 17:01:27 2010 +0200
@@ -431,7 +431,7 @@
        return r;
 }
 
-static InstrPtr
+static int 
 MATpackAll2(MalBlkPtr mb, InstrPtr mi, mat_t *mat, int m, int *mtop)
 {
        InstrPtr r = NULL;
@@ -441,6 +441,9 @@
                printInstruction(GDKout, mb, 0, mat[m].mi, LIST_MAL_ALL);
        }
        if (mat[m].type == mat_none || mat_is_topn(mat[m].type) || 
mat_is_orderby(mat[m].type)) {
+               if ((mat_is_topn(mat[m].type) || mat_is_orderby(mat[m].type)) &&
+                       !mat[m].mm) 
+                               return -1;
                r = mat_pack_mat(mb, mi, mat, m, mtop);
                pushInstruction(mb,r);
                MATshift(mat,m,mtop);
@@ -452,10 +455,9 @@
                getArg(r, 0) = mat[m].mv;
                getArg(r, 1) = mat[m].mv1;
        }
-       return r;
+       return 0;
 }
 
-
 static int
 pack_all_mats(mat_t *mat, int mtop, MalBlkPtr mb )
 {
@@ -2040,6 +2042,15 @@
                        mtop = mat_add(mat, mtop, p, NULL, mat_none);
                        continue;
                }
+
+               if (getModuleId(p) == batcalcRef &&
+                  (getFunctionId(p) == mark_grpRef ||
+                  getFunctionId(p) == dense_rank_grpRef)) { 
+                       /* Mergetable cannot handle 
+                          order related batcalc operations */
+                       error++;
+                       goto fail;
+               }
 @-
 If the instruction does not contain MAT references it can simply be added.
 Otherwise we have to decide on either packing them or replacement.
@@ -2355,7 +2366,6 @@
 
                        OPTDEBUGmergetable mnstr_printf(GDKout, "# %s.%s\n", 
getModuleId(p), getFunctionId(p));
 
-
                        if (getFunctionId(p) == mirrorRef && 
                                mat[m].type == mat_grp/* && mat[m].mm */) {
                                assert(mat[m].mm != NULL);
@@ -2391,7 +2401,10 @@
 
                for (k = p->retc; k<p->argc; k++) {
                        if((m=isMATalias(getArg(p,k), mat, mtop)) >= 0){
-                               MATpackAll2(mb, NULL, mat, m, &mtop);
+                               if (MATpackAll2(mb, NULL, mat, m, &mtop) < 0){
+                                       error++;
+                                       goto fail;
+                               }
                                actions++;
                        }
                }
diff -r 262dcfd586a9 -r 5b2be530b215 MonetDB5/src/optimizer/opt_prelude.mx
--- a/MonetDB5/src/optimizer/opt_prelude.mx     Thu Oct 28 15:33:06 2010 +0200
+++ b/MonetDB5/src/optimizer/opt_prelude.mx     Thu Oct 28 17:01:27 2010 +0200
@@ -116,6 +116,7 @@
 opt_export  str markHRef;
 opt_export  str markTRef;
 opt_export  str mark_grpRef;
+opt_export  str dense_rank_grpRef;
 opt_export  str materializeRef;
 opt_export  str matRef;
 opt_export  str max_no_nilRef;
@@ -325,6 +326,7 @@
 str markHRef;
 str markTRef;
 str mark_grpRef;
+str dense_rank_grpRef;
 str materializeRef;
 str matRef;
 str max_no_nilRef;
@@ -530,6 +532,7 @@
                markHRef = putName("markH", 5);
                markTRef = putName("markT", 5);
                mark_grpRef = putName("mark_grp", 8);
+               dense_rank_grpRef = putName("dense_rank_grp", 14);
                materializeRef = putName("materialize", 11);
                matRef = putName("mat", 3);
                max_no_nilRef = putName("max_no_nil", 10);
_______________________________________________
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to