Changeset: 659e30e1ef14 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=659e30e1ef14
Modified Files:
        gdk/gdk_bat.mx
Branch: Apr2012
Log Message:

Keep the key property a bit longer when appending to a BAT.
If we're appending the second value to a BAT, and the value is smaller
than the first, indicate that the column is reverse sorted and keep
the key property.


diffs (27 lines):

diff --git a/gdk/gdk_bat.mx b/gdk/gdk_bat.mx
--- a/gdk/gdk_bat.mx
+++ b/gdk/gdk_bat.mx
@@ -1432,6 +1432,10 @@ BUNappend(BAT *b, ptr t, bit force)
                                                b->tdense = FALSE;
                                                b->T->nodense = i;
                                        }
+                                       if (b->batCount == 1) {
+                                               b->tsorted = GDK_SORTED_REV;
+                                               goto revsorted;
+                                       }
                                } else if (cmp && b->tdense && *(oid *) t != 1 
+ *(oid *) prv) {
                                        b->T->nodense = i;
                                        b->tdense = FALSE;
@@ -1460,8 +1464,10 @@ BUNappend(BAT *b, ptr t, bit force)
                                        b->tkey = bm->hkey = b->tdense = FALSE;
                                }
                        } else if (b->tsorted == (bit) GDK_SORTED_REV) {
-                               ptr prv = BUNtail(bi, p - 1);
-
+                               ptr prv;
+
+                         revsorted:
+                               prv = BUNtail(bi, p - 1);
                                cmp = atom_CMP(t, prv, b->ttype);
                                if (cmp > 0) {
                                        b->T->nosorted_rev = i;
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to