Changeset: b0b971335885 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/b0b971335885
Modified Files:
gdk/gdk_project.c
gdk/gdk_select.c
Branch: Jul2021
Log Message:
Give heaps the correct name.
BATprojectchain of a string bat could result in the produced string
bat having an incorrect name for the offset heap. Candidate lists
could have an incorrect name for the heap when at first a view was
produced that turned out to be dense.
diffs (44 lines):
diff --git a/gdk/gdk_project.c b/gdk/gdk_project.c
--- a/gdk/gdk_project.c
+++ b/gdk/gdk_project.c
@@ -966,9 +966,16 @@ BATprojectchain(BAT **bats)
if (nonil && ATOMstorage(tpe) == TYPE_str && b->batRestricted ==
BAT_READ) {
stringtrick = true;
tpe = bi.width == 1 ? TYPE_bte : (bi.width == 2 ? TYPE_sht :
(bi.width == 4 ? TYPE_int : TYPE_lng));
+ bn = COLnew_intern(ba[0].hlo, TYPE_str, ba[0].cnt, TRANSIENT,
bi.width);
+ if (bn && bn->tvheap) {
+ /* no need to remove any files since they were
+ * never created for this bat */
+ HEAPdecref(bn->tvheap, false);
+ bn->tvheap = NULL;
+ }
+ } else {
+ bn = COLnew(ba[0].hlo, tpe, ba[0].cnt, TRANSIENT);
}
-
- bn = COLnew(ba[0].hlo, tpe, ba[0].cnt, TRANSIENT);
if (bn == NULL) {
bat_iterator_end(&bi);
goto bunins_failed;
@@ -1051,8 +1058,8 @@ BATprojectchain(BAT **bats)
assert(bn->tvheap == NULL);
bn->tvheap = bi.vh;
HEAPincref(bi.vh);
- bn->ttype = b->ttype;
- bn->tvarsized = true;
+ assert(bn->ttype == b->ttype);
+ assert(bn->tvarsized);
assert(bn->twidth == bi.width);
assert(bn->tshift == bi.shift);
}
diff --git a/gdk/gdk_select.c b/gdk/gdk_select.c
--- a/gdk/gdk_select.c
+++ b/gdk/gdk_select.c
@@ -65,6 +65,7 @@ virtualize(BAT *bn)
return NULL;
}
*h = *bn->theap;
+ settailname(h, BBP_physical(bn->batCacheid), TYPE_oid,
0);
h->parentid = bn->batCacheid;
h->base = NULL;
ATOMIC_INIT(&h->refs, 1);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list