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

Merge with default


diffs (truncated from 306 to 300 lines):

diff --git a/buildtools/autogen/autogen/am.py b/buildtools/autogen/autogen/am.py
--- a/buildtools/autogen/autogen/am.py
+++ b/buildtools/autogen/autogen/am.py
@@ -1014,7 +1014,8 @@
         fd.write("\tmkdir -p $(DESTDIR)'%s'\n" % rd)
         fd.write("\tgem install --local --install-dir $(DESTDIR)'%s' --force 
--rdoc '%s'\n" % (rd, f[:-4]))
         fd.write("uninstall-local-%s: %s\n" % (sf, f[:-4]))
-        fd.write("\tgem uninstall --install-dir $(DESTDIR)'%s' '%s'\n" % (rd, 
f[:-4]))
+        # remove "-0.1.gemspec" from end of `f'
+        fd.write("\tgem uninstall --install-dir $(DESTDIR)'%s' '%s'\n" % (rd, 
f[:-12]))
         am['BUILT_SOURCES'].append(f[:-4])
         am['CLEAN'].append(f[:-4])
     fd.write('else\n')
diff --git a/clients/ChangeLog.Apr2011 b/clients/ChangeLog.Apr2011
--- a/clients/ChangeLog.Apr2011
+++ b/clients/ChangeLog.Apr2011
@@ -1,6 +1,9 @@
 # ChangeLog file for clients
 # This file is updated with Maddlog
 
+* Fri Jul  1 2011 Fabian Groffen <[email protected]>
+- Fix stethoscope's mod.fcn filter when using multiple targets, bug #2827
+
 * Wed Jun 29 2011 Sjoerd Mullender <[email protected]>
 - The separate Python distribution now uses the same version number as
   the main package.
diff --git a/clients/mapiclient/stethoscope.c b/clients/mapiclient/stethoscope.c
--- a/clients/mapiclient/stethoscope.c
+++ b/clients/mapiclient/stethoscope.c
@@ -297,20 +297,24 @@
        } else {
                for (a = 0; a < wthr->argc; a++) {
                        char *c;
-                       c = strchr(wthr->argv[a], '.');
+                       char *arg = strdup(wthr->argv[a]);
+                       c = strchr(arg, '.');
                        if (c) {
-                               mod = wthr->argv[a];
-                               if (mod == c) mod = "*";
+                               mod = arg;
+                               if (mod == c)
+                                       mod = "*";
                                fcn = c + 1;
-                               if (*fcn == 0) fcn = "*";
+                               if (*fcn == 0)
+                                       fcn = "*";
                                *c = 0;
                        } else {
-                               fcn = wthr->argv[a];
+                               fcn = arg;
                                mod = "*";
                        }
                        snprintf(buf, BUFSIZ, 
"profiler.setFilter(\"%s\",\"%s\");", mod, fcn);
                        printf("-- %s%s\n", id, buf);
                        doQ(buf);
+                       free(arg);
                }
        }
        printf("-- %sprofiler.start();\n", id);
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -451,7 +451,7 @@
        ;;
 esac
 AC_SUBST(oids)
-AC_MSG_RESULT($bits bits)
+AC_MSG_RESULT($oids bits)
 
 AC_C_BIGENDIAN()
 
@@ -3278,7 +3278,7 @@
 done
 echo
 echo "* Important options:"
-echo "    OID size:   " ${bits} bits
+echo "    OID size:   " ${oids} bits
 echo
 
 dnl give some hints to the user
diff --git a/gdk/gdk_utils.mx b/gdk/gdk_utils.mx
--- a/gdk/gdk_utils.mx
+++ b/gdk/gdk_utils.mx
@@ -1806,7 +1806,7 @@
        if (GDKstopped == 0) {
                GDKstopped = 1; /* shouldn't there be a lock here? */
 #ifdef HAVE_POSIX_FADVISE
-               if (!GDKembedded && GDK_vm_trim)
+               if (!GDKembedded && GDK_vm_trim && GDKvmtrim_id)
                        MT_join_thread(GDKvmtrim_id);
 #endif
                GDKnrofthreads = 0;
diff --git a/geom/monetdb5/geom.mx b/geom/monetdb5/geom.mx
--- a/geom/monetdb5/geom.mx
+++ b/geom/monetdb5/geom.mx
@@ -1129,13 +1129,11 @@
        GEOSGeom_destroy(geosGeometry);
 
 #if @6
-       if (*out != @5)
-#else
-       if (1 == 1) /* trick compiler for the throw after this return */
+       if (*out == @5)
+               throw(MAL, "geom.@1", "@3 failed");
 #endif
-               return MAL_SUCCEED;
+       return MAL_SUCCEED;
 
-       throw(MAL, "geom.@1", "@3 failed");
 }
 @c
 @:basic(Dimension,int,GEOSGeom_getDimensions,,0,1)@
diff --git a/monetdb5/modules/mal/remote.mx b/monetdb5/modules/mal/remote.mx
--- a/monetdb5/modules/mal/remote.mx
+++ b/monetdb5/modules/mal/remote.mx
@@ -649,7 +649,7 @@
                        rt, ident);
        GDKfree(rt);
 
-       if (isaBatType(rtype) && (localtype == 0 || localtype != c->type || 
(getHeadType(rtype) != TYPE_void && getHeadType(rtype) != TYPE_oid)))
+       if (isaBatType(rtype) && (localtype == 0 || localtype != c->type || 
(ATOMvarsized(getHeadType(rtype)))))
        {
                int h, t, s;
                ptr l, r;
@@ -716,7 +716,6 @@
                stream *sin;
                char buf[256];
                ssize_t sz = 0, rd;
-               str err;
                BAT *b = NULL;
 
                /* this call should be a single transaction over the channel*/
@@ -735,14 +734,20 @@
                while ((rd = mnstr_read(sin, &buf[sz], 1, 1)) == 1 && buf[sz] 
!= '\n') {
                        sz += rd;
                }
-               if (rd < 0)
+               if (rd < 0) {
+                       mal_unset_lock(c->lock, "remote.get"); 
                        throw(MAL, "remote.get", "could not read BAT JSON 
header");
-               if (buf[0] == '!')
+               }
+               if (buf[0] == '!') {
+                       mal_unset_lock(c->lock, "remote.get"); 
                        return(GDKstrdup(buf));
+               }
 
                buf[sz] = '\0';
-               if ((err = RMTinternalcopyfrom(&b, buf, sin)) != NULL)
-                       return(err);
+               if ((tmp = RMTinternalcopyfrom(&b, buf, sin)) != NULL) {
+                       mal_unset_lock(c->lock, "remote.get"); 
+                       return(tmp);
+               }
 
                v->val.bval = b->batCacheid;
                v->vtype = TYPE_bat;
@@ -1201,6 +1206,9 @@
 {
        int bid = *(int *)getArgReference(stk, pci, 1);
        BAT *b = BBPquickdesc(bid, FALSE);
+       char sendhead = 0;
+       char sendtheap = 0;
+       oid Hseqbase = 0;
 
        (void)mb;
        (void)stk;
@@ -1208,32 +1216,52 @@
 
        if (b == NULL)
                throw(MAL, "remote.bincopyto", RUNTIME_OBJECT_UNDEFINED);
-       if (!(b->htype == TYPE_void || (b->htype == TYPE_oid && b->H->dense)))
-               throw(ILLARG, "remote.bincopyto", "only void-headed BATs are 
supported");
+       if (b->htype != TYPE_void && b->hvarsized)
+               throw(ILLARG, "remote.bincopyto", "varsized-headed BATs are not 
supported");
 
        BBPincref(bid, FALSE);
 
+       sendhead = b->htype != TYPE_void && (b->htype != TYPE_oid || 
!b->H->dense);
+       sendtheap = b->ttype != TYPE_void && b->tvarsized;
+
+       if (b->htype == TYPE_oid && b->H->dense) {
+               BATiter bi = bat_iterator(b);
+               Hseqbase = *(oid *)BUNhead(bi, BUNfirst(b));
+       } else {
+               Hseqbase = b->hseqbase;
+       }
+
        mnstr_printf(cntxt->fdout, /*JSON*/"{"
                        "\"version\":1,"
                        "\"htype\":%d,"
                        "\"ttype\":%d,"
-                       "\"seqbase\":" OIDFMT ","
+                       "\"hseqbase\":" OIDFMT ","
+                       "\"tseqbase\":" OIDFMT ","
                        "\"size\":" SZFMT ","
+                       "\"headsize\":" SZFMT ","
                        "\"tailsize\":" SZFMT ","
                        "\"theapsize\":" SZFMT
                        "}\n",
-                       TYPE_void,
+                       sendhead ? b->htype : TYPE_void,
                        b->ttype,
-                       b->hseqbase == oid_nil ? 0 : b->hseqbase,
+                       Hseqbase,
+                       b->tseqbase,
                        b->batCount,
+                       sendhead ? b->batCount * Hsize(b) : 0,
                        b->batCount * Tsize(b),
-                       b->tvarsized ? b->T->vheap->free : 0
+                       sendtheap && b->batCount > 0 ? b->T->vheap->free : 0
                        );
-       mnstr_write(cntxt->fdout, /* tail */
-                       Tloc(b, BUNfirst(b)), b->batCount * Tsize(b), 1);
-       if (b->tvarsized)
-               mnstr_write(cntxt->fdout, /* theap */
-                               Tbase(b), b->T->vheap->free, 1);
+
+       if (b->batCount > 0) {
+               if (sendhead)
+                       mnstr_write(cntxt->fdout, /* head */
+                                       Hloc(b, BUNfirst(b)), b->batCount * 
Hsize(b), 1);
+               mnstr_write(cntxt->fdout, /* tail */
+                               Tloc(b, BUNfirst(b)), b->batCount * Tsize(b), 
1);
+               if (sendtheap)
+                       mnstr_write(cntxt->fdout, /* theap */
+                                       Tbase(b), b->T->vheap->free, 1);
+       }
        /* flush is done by the calling environment (MAL) */
 
        BBPdecref(bid, FALSE);
@@ -1247,8 +1275,10 @@
 typedef struct _binbat_v1 {
        int Htype;
        int Ttype;
-       oid seqbase;
+       oid Hseqbase;
+       oid Tseqbase;
        size_t size;
+       size_t headsize;
        size_t tailsize;
        size_t theapsize;
 } binbat;
@@ -1256,7 +1286,7 @@
 static inline str
 RMTinternalcopyfrom(BAT **ret, char *hdr, stream *in)
 {
-       binbat bb = { 0, 0, 0, 0, 0, 0 };
+       binbat bb = { 0, 0, 0, 0, 0, 0, 0, 0 };
        char *nme = NULL;
        char *val = NULL;
        char tmp;
@@ -1300,10 +1330,14 @@
                                        bb.Htype = atoi(val);
                                } else if (strcmp(nme, "ttype") == 0) {
                                        bb.Ttype = atoi(val);
-                               } else if (strcmp(nme, "seqbase") == 0) {
-                                       bb.seqbase = (oid)atol(val);
+                               } else if (strcmp(nme, "hseqbase") == 0) {
+                                       bb.Hseqbase = (oid)atol(val);
+                               } else if (strcmp(nme, "tseqbase") == 0) {
+                                       bb.Tseqbase = (oid)atol(val);
                                } else if (strcmp(nme, "size") == 0) {
                                        bb.size = atol(val);
+                               } else if (strcmp(nme, "headsize") == 0) {
+                                       bb.headsize = atol(val);
                                } else if (strcmp(nme, "tailsize") == 0) {
                                        bb.tailsize = atol(val);
                                } else if (strcmp(nme, "theapsize") == 0) {
@@ -1319,14 +1353,20 @@
 
        /* the BAT we will return */
        b = BATnew(bb.Htype, bb.Ttype, bb.size);
-       b->hseqbase = bb.seqbase;
+       b->hseqbase = bb.Hseqbase;
+       if (bb.Ttype == TYPE_void)
+               b->tseqbase = bb.Tseqbase;
+       b->batCount = bb.size;
+
        /* for strings, the width may not match, fix it to match what we
         * retrieved */
-       if (bb.size > 0 && bb.Ttype == TYPE_str)
+       if (bb.Ttype == TYPE_str && bb.size)
                b->T->width = bb.tailsize / bb.size;
 
-       mnstr_read(in, b->T->heap.base, bb.tailsize, 1);
-       b->batCount = bb.size;
+       if (bb.headsize > 0)
+               mnstr_read(in, b->H->heap.base, bb.headsize, 1);
+       if (bb.tailsize > 0)
+               mnstr_read(in, b->T->heap.base, bb.tailsize, 1);
        if (bb.theapsize > 0) {
                if (b->T->vheap->size < bb.theapsize) {
                        GDKfree(b->T->vheap->base);
diff --git a/sql/backends/monet5/sql.mx b/sql/backends/monet5/sql.mx
--- a/sql/backends/monet5/sql.mx
+++ b/sql/backends/monet5/sql.mx
@@ -233,7 +233,7 @@
 address mvc_clear_table_wrap
 comment "Clear table";
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to