Changeset: 8d8410e894a8 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8d8410e894a8
Modified Files:
        gdk/gdk_batop.c
Branch: Feb2013
Log Message:

Fix sort shortcut when input is ordered but we want reverse ordered.


diffs (26 lines):

diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -1298,8 +1298,10 @@ BATsubsort(BAT **sorted, BAT **order, BA
                return GDK_SUCCEED;
        }
        if (BATcount(b) <= 1 ||
-           (BATtordered(b) && o == NULL && g == NULL &&
-            (groups == NULL || BATtkey(b) || BATtrevordered(b)))) {
+           ((reverse ? BATtrevordered(b) : BATtordered(b)) &&
+            o == NULL && g == NULL &&
+            (groups == NULL || BATtkey(b) ||
+             (reverse ? BATtordered(b) : BATtrevordered(b))))) {
                /* trivially (sub)sorted, and either we don't need to
                 * return group information, or we can trivially
                 * deduce the groups */
@@ -1328,7 +1330,8 @@ BATsubsort(BAT **sorted, BAT **order, BA
                        } else {
                                /* single group */
                                const oid *o = 0;
-                               assert(BATcount(b) == 1 || BATtrevordered(b));
+                               assert(BATcount(b) == 1 ||
+                                      (BATtordered(b) && BATtrevordered(b)));
                                gn = BATconstant(TYPE_oid, &o, BATcount(b));
                                if (gn == NULL)
                                        goto error;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to