Changeset: a4a321192d77 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/a4a321192d77
Modified Files:
        gdk/gdk_bat.c
        gdk/gdk_private.h
        gdk/gdk_project.c
Branch: Jul2021
Log Message:

Fix BATproject of string heap to produce correctly named tail file.


diffs (71 lines):

diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -240,7 +240,7 @@ settailname(Heap *restrict tail, const c
  * filenames.
  */
 BAT *
-COLnew(oid hseq, int tt, BUN cap, role_t role)
+COLnew_intern(oid hseq, int tt, BUN cap, role_t role, uint16_t width)
 {
        BAT *bn;
 
@@ -272,15 +272,18 @@ COLnew(oid hseq, int tt, BUN cap, role_t
 
        if (ATOMstorage(tt) == TYPE_msk)
                cap /= 8;       /* 8 values per byte */
-       else if (tt == TYPE_str)
+       else if (tt == TYPE_str) {
+               if (width != 0)
+                       bn->twidth = width;
                settailname(bn->theap, BBP_physical(bn->batCacheid), tt, 
bn->twidth);
+       }
 
        /* alloc the main heaps */
        if (tt && HEAPalloc(bn->theap, cap, bn->twidth, ATOMsize(bn->ttype)) != 
GDK_SUCCEED) {
                goto bailout;
        }
 
-       if (bn->tvheap && ATOMheap(tt, bn->tvheap, cap) != GDK_SUCCEED) {
+       if (bn->tvheap && width == 0 && ATOMheap(tt, bn->tvheap, cap) != 
GDK_SUCCEED) {
                goto bailout;
        }
        DELTAinit(bn);
@@ -303,6 +306,12 @@ COLnew(oid hseq, int tt, BUN cap, role_t
 }
 
 BAT *
+COLnew(oid hseq, int tt, BUN cap, role_t role)
+{
+       return COLnew_intern(hseq, tt, cap, role, 0);
+}
+
+BAT *
 BATdense(oid hseq, oid tseq, BUN cnt)
 {
        BAT *bn;
diff --git a/gdk/gdk_private.h b/gdk/gdk_private.h
--- a/gdk/gdk_private.h
+++ b/gdk/gdk_private.h
@@ -121,6 +121,9 @@ BUN binsearch_flt(const oid *restrict in
        __attribute__((__visibility__("hidden")));
 BUN binsearch_dbl(const oid *restrict indir, oid offset, const dbl *restrict 
vals, BUN lo, BUN hi, dbl v, int ordering, int last)
        __attribute__((__visibility__("hidden")));
+BAT *COLnew_intern(oid hseq, int tt, BUN cap, role_t role, uint16_t width)
+       __attribute__((__warn_unused_result__))
+       __attribute__((__visibility__("hidden")));
 Heap *createOIDXheap(BAT *b, bool stable)
        __attribute__((__visibility__("hidden")));
 void gdk_bbp_reset(void)
diff --git a/gdk/gdk_project.c b/gdk/gdk_project.c
--- a/gdk/gdk_project.c
+++ b/gdk/gdk_project.c
@@ -663,7 +663,7 @@ BATproject2(BAT *restrict l, BAT *restri
                }
                tpe = TYPE_oid;
        }
-       bn = COLnew(l->hseqbase, tpe, lcount, TRANSIENT);
+       bn = COLnew_intern(l->hseqbase, ATOMtype(r1->ttype), lcount, TRANSIENT, 
stringtrick ? r1->twidth : 0);
        if (bn == NULL) {
                goto doreturn;
        }
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to