Changeset: f7c9a3659dd6 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f7c9a3659dd6
Modified Files:
        
Branch: default
Log Message:

Merged heads.


diffs (118 lines):

diff -r 142086e32817 -r f7c9a3659dd6 MonetDB5/src/mal/mal_recycle.mx
--- a/MonetDB5/src/mal/mal_recycle.mx   Mon May 31 15:09:31 2010 +0200
+++ b/MonetDB5/src/mal/mal_recycle.mx   Mon May 31 15:31:10 2010 +0200
@@ -2618,10 +2618,11 @@
 #endif
                                if ( ((getFunctionId(q) == bindRef ||
                                        getFunctionId(q) == bind_idxRef ) && 
-                                       ( getVarConstant(recycleBlk, 
getArg(q,5)).val.ival == 0 )) ||
+                                       ( getVarConstant(recycleBlk, 
getArg(q,5)).val.ival <= 
+                                               getVarConstant(mb, 
getArg(p,1)).val.ival )) ||
                                        ( getFunctionId(q) == bind_dbatRef ) ){
-                                       for (j=p->retc; j<p->argc; j++)
-                                               if( VALcmp( 
&stk->stk[getArg(p,j)], &getVarConstant(recycleBlk,getArg(q,j+1))))
+                                       for (j=p->retc+1; j<p->argc; j++)
+                                               if( VALcmp( 
&stk->stk[getArg(p,j)], &getVarConstant(recycleBlk,getArg(q,j))))
                                                break;
                                        if (j == p->argc){
                                                v = 
&getVarConstant(recycleBlk,getArg(q,0));
diff -r 142086e32817 -r f7c9a3659dd6 MonetDB5/src/modules/mal/recycle.mx
--- a/MonetDB5/src/modules/mal/recycle.mx       Mon May 31 15:09:31 2010 +0200
+++ b/MonetDB5/src/modules/mal/recycle.mx       Mon May 31 15:31:10 2010 +0200
@@ -83,11 +83,15 @@
 
 pattern reset(bid:bat):void
 address RECYCLEresetCMD
-comment "Reset off all recycled variables";
+comment "Reset a recycled bat variable";
 
-pattern reset(sname:str...):void
+pattern reset(delta:int,sname:str...):void
 address RECYCLEresetCMD
-comment "Reset off all recycled variables";
+comment "Reset off all recycled variables matching the arguments:
+delta:0 only the main bat, 2 including delta bats
+sname: schema name,
+tname: table name (optional)
+cname: column name (optional)";
 
 pattern shutdown():void
 address RECYCLEshutdownWrap
diff -r 142086e32817 -r f7c9a3659dd6 MonetDB5/src/optimizer/opt_prelude.mx
--- a/MonetDB5/src/optimizer/opt_prelude.mx     Mon May 31 15:09:31 2010 +0200
+++ b/MonetDB5/src/optimizer/opt_prelude.mx     Mon May 31 15:31:10 2010 +0200
@@ -47,6 +47,7 @@
 opt_export  str bpmRef;
 opt_export  str bstreamRef;
 opt_export  str calcRef;
+opt_export  str catalogRef;
 opt_export  str clear_tableRef;
 opt_export  str closeRef;
 opt_export  str compressRef;
@@ -241,6 +242,7 @@
 str bpmRef;
 str bstreamRef;
 str calcRef;
+str catalogRef;
 str clear_tableRef;
 str closeRef;
 str compressRef;
@@ -431,6 +433,7 @@
                bpmRef = putName("bpm",3);
                bstreamRef = putName("bstream",7);
                calcRef = putName("calc",4);
+               catalogRef = putName("catalog",7);
                clear_tableRef = putName("clear_table",11);
                closeRef = putName("close",5);
                compressRef = putName("compress",8);
diff -r 142086e32817 -r f7c9a3659dd6 MonetDB5/src/optimizer/opt_recycler.mx
--- a/MonetDB5/src/optimizer/opt_recycler.mx    Mon May 31 15:09:31 2010 +0200
+++ b/MonetDB5/src/optimizer/opt_recycler.mx    Mon May 31 15:31:10 2010 +0200
@@ -109,13 +109,13 @@
 static int
 OPTrecycleImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p)
 {
-       int i, j, cnt, actions = 0, marks = 0;
+       int i, j, cnt, tp, c, actions = 0, marks = 0, delta = 0;
        Lifespan span;
        InstrPtr *old, q;
        int limit, updstmt = 0;
        char *recycled;
        short app_sc = -1, in = 0;
-
+       ValRecord cst;
 
        (void) cntxt;
        (void) stk;
@@ -176,13 +176,30 @@
                                                        continue;
                                                else app_sc = getArg(p,2);
                                        }
+                                       VALset(&cst,TYPE_int,&delta);
+                                       c = defConstant(mb, TYPE_int, &cst);
                                        q = newFcnCall(mb,"recycle","reset");
+                                       pushArgument(mb,q,c);
                                        pushArgument(mb,q, getArg(p,2));
                                        pushArgument(mb,q, getArg(p,3));
                                        if (getFunctionId(p) == updateRef)
                                                pushArgument(mb,q, getArg(p,4));
+                                       actions++;
                                }
-                               actions++;
+                       }
+                       if (getModuleId(p) == sqlRef && getFunctionId(p) == 
catalogRef ){
+                               tp = *(int*) getVarValue(mb,getArg(p,1)); 
+                               if (tp == 22 || tp == 25) {
+                                       delta = 2; 
+                                       VALset(&cst,TYPE_int,&delta);
+                                       c = defConstant(mb, TYPE_int, &cst);
+                                       q = newFcnCall(mb,"recycle","reset");
+                                       pushArgument(mb,q,c);
+                                       pushArgument(mb,q, getArg(p,2));
+                                       if ( tp == 25 )
+                                               pushArgument(mb,q, getArg(p,3));
+                                       actions++;
+                               }
                        }
                        continue;
                }
_______________________________________________
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to