Changeset: 96bae12b0d9a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=96bae12b0d9a
Modified Files:
        gdk/gdk.h
        gdk/gdk_aggr.c
        gdk/gdk_batop.c
        gdk/gdk_cand.c
        gdk/gdk_cross.c
        gdk/gdk_hash.c
        gdk/gdk_private.h
        gdk/gdk_select.c
        monetdb5/mal/mal_interpreter.c
        monetdb5/modules/mal/pcre.c
Branch: candidate-exceptions
Log Message:

Candidate iterator cleaup.


diffs (154 lines):

diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -2779,7 +2779,6 @@ gdk_export BAT *BATunique(BAT *b, BAT *s
 gdk_export BAT *BATmergecand(BAT *a, BAT *b);
 gdk_export BAT *BATintersectcand(BAT *a, BAT *b);
 gdk_export BAT *BATdiffcand(BAT *a, BAT *b);
-gdk_export bool BATcandcontains(BAT *s, oid o);
 
 gdk_export gdk_return BATfirstn(BAT **topn, BAT **gids, BAT *b, BAT *cands, 
BAT *grps, BUN n, bool asc, bool nilslast, bool distinct)
        __attribute__((__warn_unused_result__));
diff --git a/gdk/gdk_aggr.c b/gdk/gdk_aggr.c
--- a/gdk/gdk_aggr.c
+++ b/gdk/gdk_aggr.c
@@ -8,7 +8,6 @@
 
 #include "monetdb_config.h"
 #include "gdk.h"
-#include "gdk_cand.h"
 #include "gdk_private.h"
 #include "gdk_calc_private.h"
 #include <math.h>
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -17,7 +17,6 @@
 #include "monetdb_config.h"
 #include "gdk.h"
 #include "gdk_private.h"
-#include "gdk_cand.h"
 
 gdk_return
 unshare_string_heap(BAT *b)
diff --git a/gdk/gdk_cand.c b/gdk/gdk_cand.c
--- a/gdk/gdk_cand.c
+++ b/gdk/gdk_cand.c
@@ -327,40 +327,6 @@ binsearchcand(const oid *cand, BUN hi, o
        return hi;
 }
 
-bool
-BATcandcontains(BAT *s, oid o)
-{
-       BUN p;
-
-       if (s == NULL)
-               return true;
-
-       assert(ATOMtype(s->ttype) == TYPE_oid);
-       assert(s->tsorted);
-       assert(s->tkey);
-       assert(s->tnonil);
-
-       if (BATcount(s) == 0)
-               return false;
-       if (s->ttype == TYPE_void && s->tvheap) {
-               assert(s->tvheap->free % SIZEOF_OID == 0);
-               BUN nexc = (BUN) (s->tvheap->free / SIZEOF_OID);
-               if (o < s->tseqbase ||
-                   o >= s->tseqbase + BATcount(s) + nexc)
-                       return false;
-               const oid *exc = (const oid *) s->tvheap->base;
-               if (nexc > 0) {
-                       p = binsearchcand(exc, nexc - 1, o);
-                       return p == nexc || exc[p] != o;
-               }
-       }
-       if (BATtdense(s))
-               return s->tseqbase <= o && o < s->tseqbase + BATcount(s);
-       const oid *oids = Tloc(s, 0);
-       p = binsearchcand(oids, BATcount(s) - 1, o);
-       return p != BATcount(s) && oids[p] == o;
-}
-
 /* initialize a candidate iterator, return number of iterations */
 BUN
 canditer_init(struct canditer *ci, BAT *b, BAT *s)
diff --git a/gdk/gdk_cross.c b/gdk/gdk_cross.c
--- a/gdk/gdk_cross.c
+++ b/gdk/gdk_cross.c
@@ -9,7 +9,6 @@
 #include "monetdb_config.h"
 #include "gdk.h"
 #include "gdk_private.h"
-#include "gdk_cand.h"
 
 /* Calculate a cross product between bats l and r with optional
  * candidate lists sl for l and sr for r.
diff --git a/gdk/gdk_hash.c b/gdk/gdk_hash.c
--- a/gdk/gdk_hash.c
+++ b/gdk/gdk_hash.c
@@ -34,7 +34,6 @@
 
 #include "monetdb_config.h"
 #include "gdk.h"
-#include "gdk_cand.h"
 #include "gdk_private.h"
 
 static int
diff --git a/gdk/gdk_private.h b/gdk/gdk_private.h
--- a/gdk/gdk_private.h
+++ b/gdk/gdk_private.h
@@ -262,7 +262,7 @@ stpconcat(char *restrict dst, const char
                        b->hseqbase,                    \
                        ATOMname(b->ttype),             \
                        !b->batTransient ? "P" : isVIEW(b) ? "V" : "T", \
-                       BATtdense(b) ? "D" : "",        \
+                       BATtdense(b) ? "D" : b->ttype == TYPE_void && b->tvheap 
? "X" :"", \
                        b->tsorted ? "S" : "",          \
                        b->trevsorted ? "R" : "",       \
                        b->tkey ? "K" : "",             \
@@ -282,7 +282,7 @@ stpconcat(char *restrict dst, const char
                        b ? ATOMname(b->ttype) : "",    \
                        b ? "]" : "",                   \
                        b ? !b->batTransient ? "P" : isVIEW(b) ? "V" : "T" : 
"", \
-                       b && BATtdense(b) ? "D" : "",   \
+                       b && BATtdense(b) ? "D" : b && b->ttype == TYPE_void && 
b->tvheap ? "X" :"", \
                        b && b->tsorted ? "S" : "",     \
                        b && b->trevsorted ? "R" : "",  \
                        b && b->tkey ? "K" : "",        \
diff --git a/gdk/gdk_select.c b/gdk/gdk_select.c
--- a/gdk/gdk_select.c
+++ b/gdk/gdk_select.c
@@ -8,7 +8,6 @@
 
 #include "monetdb_config.h"
 #include "gdk.h"
-#include "gdk_cand.h"
 #include "gdk_private.h"
 #include <math.h>
 
diff --git a/monetdb5/mal/mal_interpreter.c b/monetdb5/mal/mal_interpreter.c
--- a/monetdb5/mal/mal_interpreter.c
+++ b/monetdb5/mal/mal_interpreter.c
@@ -18,7 +18,6 @@
 #include "mal_debugger.h"   /* for mdbStep() */
 #include "mal_type.h"
 #include "mal_private.h"
-#include "gdk_cand.h"
 
 static lng qptimeout = 0; /* how often we print still running queries (usec) */
 
diff --git a/monetdb5/modules/mal/pcre.c b/monetdb5/modules/mal/pcre.c
--- a/monetdb5/modules/mal/pcre.c
+++ b/monetdb5/modules/mal/pcre.c
@@ -1978,8 +1978,6 @@ PCRElikeselect5(bat *ret, const bat *bid
        return PCRElikeselect2(ret, bid, sid, pat, &esc, &f, anti);
 }
 
-#include "gdk_cand.h"
-
 #define APPEND(b, o)   (((oid *) b->theap.base)[b->batCount++] = (o))
 #define VALUE(s, x)            (s##vars + VarHeapVal(s##vals, (x), s##width))
 
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to