Changeset: cacb8b450311 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cacb8b450311
Modified Files:
        gdk/gdk_bbp.mx
        gdk/gdk_utils.mx
        monetdb5/mal/mal_atom.mx
        monetdb5/mal/mal_box.mx
        monetdb5/mal/mal_client.mx
        monetdb5/mal/mal_import.mx
        monetdb5/mal/mal_instruction.mx
        monetdb5/mal/mal_interpreter.mx
        monetdb5/mal/mal_profiler.mx
        monetdb5/mal/mal_resolve.mx
        monetdb5/modules/kernel/batcalc.mx
        monetdb5/modules/kernel/group.mx
        monetdb5/modules/mal/box.mx
        monetdb5/modules/mal/mal_mapi.mx
        monetdb5/modules/mal/remote.mx
        monetdb5/modules/mal/tablet.mx
        monetdb5/optimizer/opt_compression.mx
        monetdb5/optimizer/opt_constants.mx
        monetdb5/optimizer/opt_dictionary.mx
        monetdb5/optimizer/opt_emptySet.mx
        monetdb5/optimizer/opt_heuristics.mx
        monetdb5/optimizer/opt_history.mx
        monetdb5/optimizer/opt_joinpath.mx
        monetdb5/optimizer/opt_mergetable.mx
        monetdb5/optimizer/opt_multiplex.mx
        monetdb5/optimizer/opt_octopus.mx
        monetdb5/optimizer/opt_partitions.mx
        monetdb5/optimizer/opt_pushranges.mx
        monetdb5/optimizer/opt_recycler.mx
        monetdb5/optimizer/opt_remoteQueries.mx
        sql/backends/monet5/sql.mx
        sql/backends/monet5/sql_gencode.mx
        sql/backends/monet5/sql_scenario.mx
Branch: default
Log Message:

Merged from Oct2010


diffs (truncated from 615 to 300 lines):

diff -r 6db225e870ac -r cacb8b450311 gdk/gdk_bbp.mx
--- a/gdk/gdk_bbp.mx    Sat Jan 15 21:10:37 2011 +0100
+++ b/gdk/gdk_bbp.mx    Sat Jan 15 21:20:25 2011 +0100
@@ -3782,7 +3782,7 @@
        if (BBPprepare(subcommit)) {
                return -1;
        }
-       if (b->batCopiedtodisk == 0 || nme == NULL || b->batPersistence != 
PERSISTENT) {
+       if (b->batCopiedtodisk == 0 || b->batPersistence != PERSISTENT) {
                return 0;
        }
        /* determine location dir and physical suffix */
diff -r 6db225e870ac -r cacb8b450311 gdk/gdk_utils.mx
--- a/gdk/gdk_utils.mx  Sat Jan 15 21:10:37 2011 +0100
+++ b/gdk/gdk_utils.mx  Sat Jan 15 21:20:25 2011 +0100
@@ -129,6 +129,8 @@
                return 0;
        }
 
+       assert(strlen(dbname) < PATHLENGTH);
+       assert(strlen(dbfarm) < PATHLENGTH);
        strncpy(GDKdbnameStr, dbname, PATHLENGTH);
        strncpy(GDKdbfarmStr, dbfarm, PATHLENGTH);
        return 1;
diff -r 6db225e870ac -r cacb8b450311 monetdb5/mal/mal_atom.mx
--- a/monetdb5/mal/mal_atom.mx  Sat Jan 15 21:10:37 2011 +0100
+++ b/monetdb5/mal/mal_atom.mx  Sat Jan 15 21:20:25 2011 +0100
@@ -286,6 +286,8 @@
        }
        
        ATOMproperty(name,"",  (int (*)()) 0, 0);
+       if( strlen(name) >= sizeof(BATatoms[0].name))
+               return ;
        i= ATOMindex(name);
        /* overload atom ? */
        if (tpe) { 
@@ -305,6 +307,8 @@
        int i = 0;
 
        ATOMproperty(name,"",  (int (*)()) 0, 0);
+       if( strlen(name) >= sizeof(BATatoms[0].name))
+               return -1;
        i= ATOMindex(name);
        BATatoms[i] = BATatoms[TYPE_chr];
        strncpy(BATatoms[i].name, name, sizeof(BATatoms[i].name));
@@ -341,6 +345,8 @@
                return -1;  /* ERROR! */
        }
        ATOMproperty(name,"",  (int (*)()) 0, 0);
+       if( strlen(name) >= sizeof(BATatoms[0].name))
+               return -1;
        i= ATOMindex(name);
        BATatoms[i] = BATatoms[tpe];
        strncpy(BATatoms[i].name, name, sizeof(BATatoms[i].name));
diff -r 6db225e870ac -r cacb8b450311 monetdb5/mal/mal_box.mx
--- a/monetdb5/mal/mal_box.mx   Sat Jan 15 21:10:37 2011 +0100
+++ b/monetdb5/mal/mal_box.mx   Sat Jan 15 21:20:25 2011 +0100
@@ -437,7 +437,7 @@
        vr.vtype = TYPE_str;
        vr.val.sval = val? val: (str)str_nil;
        vr.len = (int)strlen(vr.val.sval);
-       depositBox(box, nme, TYPE_str, &vr);
+       (void) depositBox(box, nme, TYPE_str, &vr);
 }
 
 @-
diff -r 6db225e870ac -r cacb8b450311 monetdb5/mal/mal_client.mx
--- a/monetdb5/mal/mal_client.mx        Sat Jan 15 21:10:37 2011 +0100
+++ b/monetdb5/mal/mal_client.mx        Sat Jan 15 21:20:25 2011 +0100
@@ -461,9 +461,9 @@
 #ifdef MAL_CLIENT_DEBUG
        printf("# Exit client %d\n", c->idx);
 #endif
+       MPresetProfiler(c->fdout);
        if (c->father == NULL) { /* normal client */
                if( c->fdout && c->fdout != GDKstdout){
-                       MPresetProfiler(c->fdout);
                        (void) mnstr_close(c->fdout);
                        (void) mnstr_destroy(c->fdout);
                }
@@ -484,9 +484,9 @@
                mal_set_lock(mal_contextLock, "wait");
                c->mode = AWAITING;
                /* close streams */
+               mal_unset_lock(mal_contextLock, "wait");
                MCexitClient(c);
                /* wait for work */
-               mal_unset_lock(mal_contextLock, "wait");
 #ifdef MAL_DEBUG_CLIENT
                mnstr_printf(c->fdout,"Put client into pool %d\n",c->idx);
 #endif
diff -r 6db225e870ac -r cacb8b450311 monetdb5/mal/mal_instruction.mx
--- a/monetdb5/mal/mal_instruction.mx   Sat Jan 15 21:10:37 2011 +0100
+++ b/monetdb5/mal/mal_instruction.mx   Sat Jan 15 21:20:25 2011 +0100
@@ -1305,9 +1305,7 @@
        i = findVariable(mb, nme);
        if (i < 0)
                return getTypeIndex(nme, -1, TYPE_any);
-       if (i >= 0)
-               return getVarType(mb, i);
-       return TYPE_any;
+       return getVarType(mb, i);
 }
 
 str
diff -r 6db225e870ac -r cacb8b450311 monetdb5/mal/mal_interpreter.mx
--- a/monetdb5/mal/mal_interpreter.mx   Sat Jan 15 21:10:37 2011 +0100
+++ b/monetdb5/mal/mal_interpreter.mx   Sat Jan 15 21:20:25 2011 +0100
@@ -449,7 +449,7 @@
                int stoppc, MalStkPtr stk, MalStkPtr env, InstrPtr pcicaller)
 {
        ValPtr lhs,rhs,v;
-       int i,k; 
+       int i,k;
        InstrPtr pci=0;
        int exceptionVar,prevpc=0;
        str ret=0;
@@ -2321,7 +2321,7 @@
 @= exceptionHndlr
 if(cntxt->errbuf && cntxt->errbuf[0] ) {
        str oldret = ret;
-       ret = catchKernelException(cntxt, oldret);
+       ret = catchKernelException(cntxt, ret);
        FREE_EXCEPTION(oldret);
 }
 
diff -r 6db225e870ac -r cacb8b450311 monetdb5/mal/mal_profiler.mx
--- a/monetdb5/mal/mal_profiler.mx      Sat Jan 15 21:10:37 2011 +0100
+++ b/monetdb5/mal/mal_profiler.mx      Sat Jan 15 21:20:25 2011 +0100
@@ -276,6 +276,7 @@
 mal_export lng getDiskWrites(void);
 mal_export lng getUserTime(void);
 mal_export lng getSystemTime(void);
+mal_export void _initTrace(void);
 
 #endif
 @+ Performance tracing
@@ -765,6 +766,7 @@
 should wait for the next instruction the stream
 is initiated. This is controlled by a delay-switch
 @c
+static int TRACE_init = 0;
 str
 startProfiling(void)
 {
@@ -774,7 +776,8 @@
                delayswitch = 1;
        } else
                cachedProfiling = TRUE;
-       initTrace();
+       if (TRACE_init == 0)
+               _initTrace();
        malProfileMode = TRUE;
        mal_unset_lock(mal_profileLock, "profileLock");
        return MAL_SUCCEED;
@@ -976,7 +979,6 @@
 All properties identified below are maintained, because this allows
 for easy integration with SQL.
 @c
-static int TRACE_init = 0;
 static int TRACE_event = 0;
 static BAT *TRACE_id_event = 0;
 static BAT *TRACE_id_time = 0;
diff -r 6db225e870ac -r cacb8b450311 monetdb5/modules/kernel/batcalc.mx
--- a/monetdb5/modules/kernel/batcalc.mx        Sat Jan 15 21:10:37 2011 +0100
+++ b/monetdb5/modules/kernel/batcalc.mx        Sat Jan 15 21:20:25 2011 +0100
@@ -700,22 +700,22 @@
 nor being a persistent BAT
 */
 batcalc_export str CMDbataccum@2_@3_@4_@5(int *ret, int *l, int *r, bit 
*lflag, bit *rflag);
-str CMDbataccum@2_@3_@4_@5(int *ret, int *l, int *r, bit *lflag, bit *rflag)
+str CMDbataccum@2_@3_@4_@5(int *ret, int *l, int *ri, bit *lflag, bit *rflag)
 {      
        BAT *bn, *b, *right;
        char *res = MAL_SUCCEED;
 
        @:getBATdescriptor(l,b,"batcalc.@1")@
-       @:getBATdescriptor(r,right,"batcalc.@1")@
+       @:getBATdescriptor(ri,right,"batcalc.@1")@
 
        if( *lflag && !isVIEW(b) && BBP_refs(*l) == 1 && BBP_lrefs(*l) == 1)
                bn = b;
-       else if( *rflag && !isVIEW(right) && BBP_refs(*r) == 1 &&  
BBP_lrefs(*r) == 1)
+       else if( *rflag && !isVIEW(right) && BBP_refs(*ri) == 1 &&  
BBP_lrefs(*ri) == 1)
                bn = right;
        else {
                BBPreleaseref(b->batCacheid);
                BBPreleaseref(right->batCacheid);
-               return CMDbat@2_@3_@4_@5(ret,l,r);
+               return CMDbat@2_@3_@4_@5(ret,l,ri);
        }
 
        @:chkSize(bn,b,CMDbataccum@2)@
@@ -1412,10 +1412,10 @@
        if (!(bn->batDirty&2)) bn = BATsetaccess(bn, BAT_READ); 
 
        if (b->htype != bn->htype) {
-               BAT *r = VIEWcreate(b,bn);
+               BAT *rview = VIEWcreate(b,bn);
 
                BBPreleaseref(bn->batCacheid);
-               bn = r;
+               bn = rview;
        }
        BBPkeepref(*ret= bn->batCacheid);
        BBPreleaseref(b->batCacheid);
diff -r 6db225e870ac -r cacb8b450311 monetdb5/modules/kernel/group.mx
--- a/monetdb5/modules/kernel/group.mx  Sat Jan 15 21:10:37 2011 +0100
+++ b/monetdb5/modules/kernel/group.mx  Sat Jan 15 21:20:25 2011 +0100
@@ -1153,7 +1153,7 @@
                return GDK_FAIL;
        /* complete result histo */
        hn = BATnew(TYPE_oid, TYPE_wrd, BATcount(_b));
-       if (!mn) {
+       if (!hn) {
                BBPreclaim(mn);
                return GDK_FAIL;
        }
@@ -1715,6 +1715,8 @@
 {
        /* printf("#init group\n"); */
        TYPE_mapentry = malAtomFixed(sizeof(mapentry_t), sizeof(oid), 
"mapentry");
+       if ( TYPE_mapentry < 0)
+               throw(MAL,"group.prelude", RUNTIME_OBJECT_MISSING);
        return MAL_SUCCEED;
 }
 
diff -r 6db225e870ac -r cacb8b450311 monetdb5/modules/mal/box.mx
--- a/monetdb5/modules/mal/box.mx       Sat Jan 15 21:10:37 2011 +0100
+++ b/monetdb5/modules/mal/box.mx       Sat Jan 15 21:20:25 2011 +0100
@@ -261,7 +261,7 @@
        @:OpenBox(iterator)@
        cursor = (lng *) getArgReference(stk, pci, 0);
        v = getArgReference(stk,pci,2); 
-       nextBoxElement(box, cursor, v);
+       (void) nextBoxElement(box, cursor, v);
        return MAL_SUCCEED;
 }
 
diff -r 6db225e870ac -r cacb8b450311 monetdb5/modules/mal/mal_mapi.mx
--- a/monetdb5/modules/mal/mal_mapi.mx  Sat Jan 15 21:10:37 2011 +0100
+++ b/monetdb5/modules/mal/mal_mapi.mx  Sat Jan 15 21:20:25 2011 +0100
@@ -624,7 +624,7 @@
  * localhost.
  */
 void SERVERannounce(struct in_addr addr, int port, str usockfile) {
-       str buf = alloca(sizeof(char) * 1024);
+       str buf;
        str host = NULL;
        int ret = 0;
 
@@ -760,7 +760,7 @@
 
                /* prevent silent truncation, sun_path is typically around 108
                 * chars long :/ */
-               if (strlen(usockfile) > sizeof(userver.sun_path))
+               if (strlen(usockfile) >= sizeof(userver.sun_path))
                        throw(MAL, "mal_mapi.listen",
                                        OPERATION_FAILED ": UNIX socket path 
too long: %s",
                                        usockfile);
diff -r 6db225e870ac -r cacb8b450311 monetdb5/modules/mal/remote.mx
--- a/monetdb5/modules/mal/remote.mx    Sat Jan 15 21:10:37 2011 +0100
+++ b/monetdb5/modules/mal/remote.mx    Sat Jan 15 21:20:25 2011 +0100
@@ -673,7 +673,7 @@
                        mal_unset_lock(c->lock, "remote.get"); 
                        return tmp;
                }
-               mapi_fetch_row(mhdl); /* should succeed */
+               (void) mapi_fetch_row(mhdl); /* should succeed */
                val = mapi_fetch_field(mhdl, 0);
 
                if (ATOMvarsized(rtype)) {
diff -r 6db225e870ac -r cacb8b450311 monetdb5/modules/mal/tablet.mx
--- a/monetdb5/modules/mal/tablet.mx    Sat Jan 15 21:10:37 2011 +0100
+++ b/monetdb5/modules/mal/tablet.mx    Sat Jan 15 21:20:25 2011 +0100
@@ -2437,8 +2437,6 @@
        unsigned int i;
        BUN cnt;
 
-       if (t->columns[0].c == 0)
-               return 0;
        cnt = BATcount(t->columns[0].c[0]);
        for (i = 0; i < t->nr_attrs; i++)
                if (t->columns[i].c[0] == 0)
diff -r 6db225e870ac -r cacb8b450311 monetdb5/optimizer/opt_compression.mx
--- a/monetdb5/optimizer/opt_compression.mx     Sat Jan 15 21:10:37 2011 +0100
+++ b/monetdb5/optimizer/opt_compression.mx     Sat Jan 15 21:20:25 2011 +0100
@@ -93,7 +93,8 @@
 
        limit= mb->stop;
        old = mb->stmt;
-       newMalBlkStmt(mb, mb->ssize);
+       if ( newMalBlkStmt(mb, mb->ssize) < 0)
+               return 0;
        pushInstruction(mb,old[0]);
 
        for (i = 1; i<limit; i++) {
@@ -112,8 +113,7 @@
                                getVarConstant(mb,getArg(p,2)).val.sval,
                                getVarConstant(mb,getArg(p,3)).val.sval,
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to