Changeset: e0bc3daa06b9 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e0bc3daa06b9
Modified Files:
        monetdb5/modules/kernel/batstr.c
Branch: Oct2012
Log Message:

batstr.string: make it return non-garbage

bunfastins doesn't want a pointer to a pointer, so don't give it one

(makes batstr test run correctly)


diffs (78 lines):

diff --git a/monetdb5/modules/kernel/batstr.c b/monetdb5/modules/kernel/batstr.c
--- a/monetdb5/modules/kernel/batstr.c
+++ b/monetdb5/modules/kernel/batstr.c
@@ -876,7 +876,7 @@ str STRbatTail(int *ret, int *l, int *r)
        BATiter lefti, righti;
        BAT *bn, *left, *right;
        BUN p,q;
-       str v, *vp= &v;
+       str v;
 
        prepareOperand2(left,l,right,r,);
        if( BATcount(left) != BATcount(right) )
@@ -886,26 +886,20 @@ str STRbatTail(int *ret, int *l, int *r)
        lefti = bat_iterator(left);
        righti = bat_iterator(right);
 
-       BATaccessBegin(left, USE_HEAD|USE_TAIL, MMAP_SEQUENTIAL);
-       BATaccessBegin(right, USE_TAIL, MMAP_SEQUENTIAL);
        BATloop(left, p, q) {
                ptr h = BUNhead(lefti,p);
                ptr tl = BUNtail(lefti,p);
                ptr tr = BUNtail(righti,p);
-               strTail(vp, tl, tr);
-               bunfastins(bn, h, vp);
+               strTail(&v, tl, tr);
+               bunfastins(bn, h, v);
                GDKfree(v);
        }
        bn->T->nonil = 0;
-       BATaccessEnd(left, USE_HEAD|USE_TAIL, MMAP_SEQUENTIAL);
-       BATaccessEnd(right, USE_TAIL, MMAP_SEQUENTIAL);
        BBPreleaseref(right->batCacheid);
        finalizeResult(ret,bn,left);
        return MAL_SUCCEED;
 
 bunins_failed:
-       BATaccessEnd(left, USE_HEAD|USE_TAIL, MMAP_SEQUENTIAL);
-       BATaccessEnd(right, USE_TAIL, MMAP_SEQUENTIAL);
        BBPreleaseref(left->batCacheid);
        BBPreleaseref(right->batCacheid);
        BBPunfix(*ret);
@@ -917,32 +911,30 @@ str STRbatTailcst(int *ret, int *l, int 
        BATiter lefti;
        BAT *bn, *left;
        BUN p,q;
-       str v, *vp= &v;
+       str v;
 
        prepareOperand(left,l,);
        prepareResult(bn,left,TYPE_str,);
 
        lefti = bat_iterator(left);
 
-       BATaccessBegin(left, USE_HEAD|USE_TAIL, MMAP_SEQUENTIAL);
        BATloop(left, p, q) {
                ptr h = BUNhead(lefti,p);
                ptr tl = BUNtail(lefti,p);
-               strTail(vp, tl, cst);
-               bunfastins(bn, h, vp);
+               strTail(&v, tl, cst);
+               bunfastins(bn, h, v);
                GDKfree(v);
        }
        bn->T->nonil = 0;
-       BATaccessEnd(left, USE_HEAD|USE_TAIL, MMAP_SEQUENTIAL);
        finalizeResult(ret,bn,left);
        return MAL_SUCCEED;
 
 bunins_failed:
-       BATaccessEnd(left, USE_HEAD|USE_TAIL, MMAP_SEQUENTIAL);
        BBPreleaseref(left->batCacheid);
        BBPreleaseref(*ret);
        throw(MAL, "batstr", OPERATION_FAILED " During bulk operation");
 }
+
 str STRbatWChrAt(int *ret, int *l, int *r)
 {   
        BATiter lefti, righti;
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to