Changeset: ec293a39a4bf for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ec293a39a4bf
Modified Files:
monetdb5/mal/Tests/tst866.stable.out
monetdb5/modules/kernel/bat5.c
Branch: Oct2014
Log Message:
Fix bat.reusemap + approve corrected output.
diffs (48 lines):
diff --git a/monetdb5/mal/Tests/tst866.stable.out
b/monetdb5/mal/Tests/tst866.stable.out
--- a/monetdb5/mal/Tests/tst866.stable.out
+++ b/monetdb5/mal/Tests/tst866.stable.out
@@ -74,7 +74,7 @@ end main;
#-----------------#
[ 0@0, 0@0 ]
[ 1@0, 8@0 ]
-[ 2@0, 7@0 ]
+[ 2@0, 6@0 ]
[ 3@0, 3@0 ]
[ 4@0, 4@0 ]
[ 5@0, 5@0 ]
diff --git a/monetdb5/modules/kernel/bat5.c b/monetdb5/modules/kernel/bat5.c
--- a/monetdb5/modules/kernel/bat5.c
+++ b/monetdb5/modules/kernel/bat5.c
@@ -2228,7 +2228,7 @@ BKCreuseBAT(int *ret, int *bid, int *did
BBPreleaseref(b->batCacheid);
throw(MAL, "bat.reuse", RUNTIME_OBJECT_MISSING);
}
- bn= BATnew(b->htype, b->ttype, BATcount(b) - BATcount(d) , TRANSIENT);
+ bn= BATnew(b->htype, b->ttype, BATcount(b) - BATcount(d), TRANSIENT);
if (bn == NULL) {
BBPreleaseref(b->batCacheid);
BBPreleaseref(d->batCacheid);
@@ -2321,7 +2321,7 @@ BKCreuseBATmap(int *ret, int *bid, int *
BBPreleaseref(b->batCacheid);
throw(MAL, "bat.shrinkMap", RUNTIME_OBJECT_MISSING);
}
- bn= BATnew(TYPE_void, TYPE_oid, BATcount(b) , TRANSIENT);
+ bn= BATnew(TYPE_void, TYPE_oid, BATcount(b) - BATcount(d), TRANSIENT);
if (bn == NULL) {
BBPreleaseref(b->batCacheid);
BBPreleaseref(d->batCacheid);
@@ -2336,12 +2336,12 @@ BKCreuseBATmap(int *ret, int *bid, int *
}
oidx = b->hseqbase;
- bidx = oidx + BUNlast(b)-1;
+ bidx = oidx + BATcount(b)-1;
o = (oid*)Tloc(bs, BUNfirst(bs));
ol = (oid*)Tloc(bs, BUNlast(bs));
r = (oid*)Tloc(bn, BUNfirst(bn));
- for (;oidx<bidx; oidx++) {
+ for (; oidx <= bidx; oidx++) {
if ( *o == oidx ){
while ( ol > o && ol[-1] == bidx) {
bidx--;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list