Changeset: b2cbb99ad49c for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b2cbb99ad49c Modified Files: gdk/gdk.h gdk/gdk_cand.c gdk/gdk_private.h monetdb5/modules/mal/projectionpath.c Branch: unlock Log Message:
Reinstate BATiscand as function, but don't use it when oid/msk is good enough. diffs (57 lines): diff --git a/gdk/gdk.h b/gdk/gdk.h --- a/gdk/gdk.h +++ b/gdk/gdk.h @@ -1231,7 +1231,6 @@ gdk_export void GDKqsort(void *restrict /* BATtvoid: BAT can be (or actually is) represented by TYPE_void */ #define BATtvoid(b) (BATtdense(b) || (b)->ttype==TYPE_void) #define BATtkey(b) ((b)->tkey || BATtdense(b)) -bool BATiscand(BAT *b); /* set some properties that are trivial to deduce */ static inline void diff --git a/gdk/gdk_cand.c b/gdk/gdk_cand.c --- a/gdk/gdk_cand.c +++ b/gdk/gdk_cand.c @@ -11,6 +11,18 @@ #include "gdk_private.h" #include "gdk_cand.h" +bool +BATiscand(BAT *b) +{ + if (b->ttype == TYPE_msk) + return true; + if (ATOMtype(b->ttype) != TYPE_oid) + return false; + if (b->ttype == TYPE_void && is_oid_nil(b->tseqbase)) + return false; + return BATtordered(b) && BATtkey(b); +} + /* create a new, dense candidate list with values from `first' up to, * but not including, `last' */ static inline BAT * diff --git a/gdk/gdk_private.h b/gdk/gdk_private.h --- a/gdk/gdk_private.h +++ b/gdk/gdk_private.h @@ -78,6 +78,8 @@ gdk_return BAThashsave(BAT *b, bool dosy __attribute__((__visibility__("hidden"))); void BATinit_idents(BAT *bn) __attribute__((__visibility__("hidden"))); +bool BATiscand(BAT *b) + __attribute__((__visibility__("hidden"))); BAT *BATload_intern(bat bid, bool lock) __attribute__((__visibility__("hidden"))); gdk_return BATmaterialize(BAT *b) diff --git a/monetdb5/modules/mal/projectionpath.c b/monetdb5/modules/mal/projectionpath.c --- a/monetdb5/modules/mal/projectionpath.c +++ b/monetdb5/modules/mal/projectionpath.c @@ -29,7 +29,7 @@ ALGprojectionpath(Client cntxt, MalBlkPt for (i = pci->retc; i < pci->argc; i++) { bid = *getArgReference_bat(stk, pci, i); b = BATdescriptor(bid); - if (b == NULL || (i + 1 < pci->argc && (!BATiscand(b) && ATOMtype(b->ttype) != TYPE_oid))) { + if (b == NULL || (i + 1 < pci->argc && ATOMtype(b->ttype) != TYPE_oid && b->ttype != TYPE_msk)) { while (--i >= pci->retc) BBPunfix(joins[i - pci->retc]->batCacheid); GDKfree(joins); _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list