Changeset: eb46eed28af8 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=eb46eed28af8
Modified Files:
gdk/gdk_batop.c
Branch: Jun2016
Log Message:
Materialize void column before attempting to sort it.
If reverse sorting a void column, we need oids instead.
diffs (30 lines):
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -1199,6 +1199,8 @@ BATsort(BAT **sorted, BAT **order, BAT *
assert(g->ttype == TYPE_oid);
grps = (oid *) Tloc(g, BUNfirst(g));
prev = grps[0];
+ if (BATmaterialize(bn) != GDK_SUCCEED)
+ goto error;
for (r = 0, p = 1, q = BATcount(g); p < q; p++) {
if (grps[p] != prev) {
/* sub sort [r,p) */
@@ -1232,11 +1234,12 @@ BATsort(BAT **sorted, BAT **order, BAT *
b->tsorted = b->trevsorted = 1;
}
if (!(reverse ? bn->trevsorted : bn->tsorted) &&
- do_sort(Tloc(bn, BUNfirst(bn)),
- on ? Tloc(on, BUNfirst(on)) : NULL,
- bn->T->vheap ? bn->T->vheap->base : NULL,
- BATcount(bn), Tsize(bn), on ? Tsize(on) : 0,
- bn->ttype, reverse, stable) != GDK_SUCCEED)
+ (BATmaterialize(bn) != GDK_SUCCEED ||
+ do_sort(Tloc(bn, BUNfirst(bn)),
+ on ? Tloc(on, BUNfirst(on)) : NULL,
+ bn->T->vheap ? bn->T->vheap->base : NULL,
+ BATcount(bn), Tsize(bn), on ? Tsize(on) : 0,
+ bn->ttype, reverse, stable) != GDK_SUCCEED))
goto error;
bn->tsorted = !reverse;
bn->trevsorted = reverse;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list