Changeset: 3bd0391266e9 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3bd0391266e9
Modified Files:
        monetdb5/modules/mal/Tests/remote08.mal
        monetdb5/modules/mal/Tests/remote08.stable.out
        monetdb5/modules/mal/remote.mx
Branch: default
Log Message:

remote.get: use more macros in binary code

In octopus, a strange segfault occurred in the sending code of the
binary BAT transfer.  Use more macros from gdk.mx to retrieve the values
we're looking for.  Updated remote08 test to perform more
complex/interesting scenario regarding the pointers and their offsets.


diffs (77 lines):

diff --git a/monetdb5/modules/mal/Tests/remote08.mal 
b/monetdb5/modules/mal/Tests/remote08.mal
--- a/monetdb5/modules/mal/Tests/remote08.mal
+++ b/monetdb5/modules/mal/Tests/remote08.mal
@@ -8,6 +8,11 @@
 
 b := bat.insert(b, nil:oid, 2);
 b := bat.insert(b, nil:oid, 4);
+b := bat.insert(b, nil:oid, 6);
+b := bat.delete(b, nil:oid, 2);
+b := bat.insert(b, nil:oid, 8);
+b := bat.insert(b, nil:oid, 10);
+b := algebra.slice(b, 1, 2);
 b := algebra.markH(b);
 rb2 := remote.put(conn1, b);
 
diff --git a/monetdb5/modules/mal/Tests/remote08.stable.out 
b/monetdb5/modules/mal/Tests/remote08.stable.out
--- a/monetdb5/modules/mal/Tests/remote08.stable.out
+++ b/monetdb5/modules/mal/Tests/remote08.stable.out
@@ -23,6 +23,11 @@
     b := bat.new(:oid,:int);
     b := bat.insert(b,nil:oid,2);
     b := bat.insert(b,nil:oid,4);
+    b := bat.insert(b,nil:oid,6);
+    b := bat.delete(b,nil:oid,2);
+    b := bat.insert(b,nil:oid,8);
+    b := bat.insert(b,nil:oid,10);
+    b := algebra.slice(b,1,2);
     b := algebra.markH(b);
     rb2 := remote.put(conn1,b);
     lb2:bat[:oid,:int]  := remote.get(conn1,rb2);
@@ -35,8 +40,8 @@
 # h    t         # name
 # void int       # type
 #-----------------#
-[ 0@0,   2       ]
-[ 1@0,   4       ]
+[ 0@0,   4       ]
+[ 1@0,   8       ]
 
 # 13:26:30 >  
 # 13:26:30 >  Done.
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
@@ -1223,17 +1223,15 @@
                        TYPE_void,
                        b->ttype,
                        b->hseqbase == oid_nil ? 0 : b->hseqbase,
-                       BATcount(b),
-                       BATcount(b) * b->T->width,
-                       b->T->varsized ? b->T->vheap->free : 0
+                       b->batCount,
+                       b->batCount * Tsize(b),
+                       b->tvarsized ? b->T->vheap->free : 0
                        );
        mnstr_write(cntxt->fdout, /* tail */
-                       b->T->heap.base + (b->U->first * b->T->width),
-                       BATcount(b) * b->T->width, 1);
-       if (b->T->varsized)
+                       Tloc(b, BUNfirst(b)), b->batCount * Tsize(b), 1);
+       if (b->tvarsized)
                mnstr_write(cntxt->fdout, /* theap */
-                               b->T->vheap->base,
-                               b->T->vheap->free, 1);
+                               Tbase(b), b->T->vheap->free, 1);
        mnstr_flush(cntxt->fdout);
 
        return(MAL_SUCCEED);
@@ -1319,7 +1317,7 @@
        b->hseqbase = bb.seqbase;
 
        mnstr_read(in, b->T->heap.base, bb.tailsize, 1);
-       b->U->count = bb.size;
+       b->batCount = bb.size;
        if (bb.theapsize > 0) {
                if (b->T->vheap->size < bb.theapsize) {
                        GDKfree(b->T->vheap->base);
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to