Changeset: af0c8d7c1620 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=af0c8d7c1620
Modified Files:
        gdk/gdk_setop.mx
Branch: Oct2012
Log Message:

Set the accomplished properties of (s|k)unique after aligniment with the input 
BAT.

ALIGNset will overwrite the key property of the output BAT, if input BAT was 
allready unique before (k|s)unique was called. Thats why is better to set key 
after the test for alignment.

Consider backporting this to Feb2013 branch.
(transplanted from f282c460d69c65e1a467c061074feb1ab1b7bdf0)


diffs (35 lines):

diff --git a/gdk/gdk_setop.mx b/gdk/gdk_setop.mx
--- a/gdk/gdk_setop.mx
+++ b/gdk/gdk_setop.mx
@@ -334,7 +334,6 @@ BATkunique(BAT *b)
        if (b->halign == 0) {
                b->halign = OIDnew(1);
        }
-       BATkey(bn, TRUE);       /* this we accomplished */
        BATkey(BATmirror(bn), BATtkey(b));
        bn->hsorted = BAThordered(b);
        bn->hrevsorted = BAThrevordered(b);
@@ -345,6 +344,7 @@ BATkunique(BAT *b)
        if (BATcount(bn) == BATcount(b)) {
                ALIGNset(bn, b);
        }
+       BATkey(bn, TRUE);       /* this we accomplished */
        return bn;
 }
 
@@ -380,7 +380,6 @@ BATsunique(BAT *b)
        }
 
        /* property management */
-       BATset(bn, TRUE);       /* this we accomplished */
        BATkey(bn, BAThkey(b));
        BATkey(BATmirror(bn), BATtkey(b));
        bn->hsorted = BAThordered(b);
@@ -392,6 +391,7 @@ BATsunique(BAT *b)
        if (BATcount(bn) == BATcount(b)) {
                ALIGNset(bn, b);
        }
+       BATset(bn, TRUE);       /* this we accomplished */
        return bn;
 }
 
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to