Changeset: d388fa2a70e9 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d388fa2a70e9
Modified Files:
        gdk/gdk_group.c
Branch: Oct2014
Log Message:

make sure we have the proper head seqbase on BATgroup (in case
of persistent shared hashes)


diffs (37 lines):

diff --git a/gdk/gdk_group.c b/gdk/gdk_group.c
--- a/gdk/gdk_group.c
+++ b/gdk/gdk_group.c
@@ -92,7 +92,7 @@
                        }                                               \
                }                                                       \
                if (extents)                                            \
-                       exts[ngrp] = b->hseqbase + (oid) (p - r);       \
+                       exts[ngrp] = hseqb + (oid) (p - r);             \
                if (histo)                                              \
                        cnts[ngrp] = 1;                                 \
                ngrps[p - r] = ngrp;                                    \
@@ -381,7 +381,7 @@ BATgroup_internal(BAT **groups, BAT **ex
        int t;
        int (*cmp)(const void *, const void *);
        const oid *grps = NULL;
-       oid *restrict ngrps, ngrp, prev = 0;
+       oid *restrict ngrps, ngrp, prev = 0, hseqb = 0;
        oid *restrict exts = NULL;
        wrd *restrict cnts = NULL;
        BUN p, q, r;
@@ -414,6 +414,7 @@ BATgroup_internal(BAT **groups, BAT **ex
        /* we want our output to go somewhere */
        assert(groups != NULL);
 
+       hseqb = b->hseqbase;
        if (b->tkey || BATcount(b) <= 1 || (g && (g->tkey || BATtdense(g)))) {
                /* grouping is trivial: 1 element per group */
                ALGODEBUG fprintf(stderr, "#BATgroup(b=%s#" BUNFMT ","
@@ -786,6 +787,7 @@ BATgroup_internal(BAT **groups, BAT **ex
                        BAT *b2 = BBPdescriptor(-parent);
                        lo = (BUN) ((b->T->heap.base - b2->T->heap.base) >> 
b->T->shift) + BUNfirst(b);
                        hi = lo + BATcount(b);
+                       hseqb = b->hseqbase;
                        b = b2;
                        bi = bat_iterator(b);
                } else {
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to