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

Merge with default branch.


diffs (47 lines):

diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -663,11 +663,12 @@
                th = tl;
                hval = 1;       /* equi-select */
        } else {
-               hval = ATOMcmp(t, th, nil);
+               hval = ATOMcmp(t, th, nil) != 0;
        }
-       if (anti) {
-               equi = 0;
-               if (!lval || !hval) {   /* swap sub-ranges */
+       if (nequi) {
+               if (!lval != !hval) {
+                       /* one of the end points is nil and the other
+                        * isn't: swap sub-ranges */
                        ptr tv;
                        bit ti;
                        ti = li;
@@ -676,8 +677,24 @@
                        tv = tl;
                        tl = th;
                        th = tv;
-                       anti = 0;
-               }
+                       nequi = 0;
+                       equi = 0;
+               } else if (!lval && !hval) {
+                       /* antiselect for nil-nil range: all non-nil
+                        * values are in range, so we need to return
+                        * all but, but we also don't want to return
+                        * nils, so instead we return nothing. */
+                       return COLnewdensecol(0);
+               } else if (equi && lnil) {
+                       /* antiselect for nil value: turn into range
+                        * select for nil-nil range (i.e. everything
+                        * but nil) */
+                       equi = 0;
+                       nequi = 0;
+                       lval = 0;
+                       hval = 0;
+               } else
+                       equi = 0;
        }
 
        if (hval && ((ATOMcmp(t, tl, th) > 0) || (equi && !(li && hi)))) {
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to