Changeset: 68945df6daa7 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=68945df6daa7
Modified Files:
        gdk/gdk_bbp.c
        sql/storage/bat/bat_utils.c
Branch: Jul2015
Log Message:

Better support compiling for 128 bit integers, but not installing the support.
When using pre-built packages (RPM, DEB) you can choose to not install
hugeint support.  The database should then not require a int128
capable build to open it.


diffs (76 lines):

diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -113,6 +113,12 @@ static BAT *getBBPdescriptor(bat i, int 
 static gdk_return BBPbackup(BAT *b, bit subcommit);
 static gdk_return BBPdir(int cnt, bat *subcommit);
 
+#ifdef HAVE_HGE
+/* start out by saying we have no hge, but as soon as we've seen one,
+ * we'll always say we do have it */
+static int havehge = 0;
+#endif
+
 #define BBPnamecheck(s) (BBPtmpcheck(s) ? ((s)[3] == '_' ? strtol((s) + 4, 
NULL, 8) : -strtol((s) + 5, NULL, 8)) : 0)
 
 #ifdef ATOMIC_LOCK
@@ -722,6 +728,10 @@ heapinit(COLrec *col, const char *buf, i
        /* silently convert chr columns to bte */
        if (strcmp(type, "chr") == 0)
                strcpy(type, "bte");
+#ifdef HAVE_HGE
+       else if (strcmp(type, "hge") == 0)
+               havehge = 1;
+#endif
        if ((t = ATOMindex(type)) < 0)
                t = ATOMunknown_find(type);
        else if (var != (t == TYPE_void || BATatoms[t].atomPut != NULL))
@@ -1331,7 +1341,11 @@ static gdk_return
 BBPdir_header(FILE *f, int n)
 {
        if (fprintf(f, "BBP.dir, GDKversion %d\n%d %d %d\n",
-                   GDKLIBRARY, SIZEOF_SIZE_T, SIZEOF_OID, SIZEOF_MAX_INT) < 0 
||
+                   GDKLIBRARY, SIZEOF_SIZE_T, SIZEOF_OID,
+#ifdef HAVE_HGE
+                   havehge ? SIZEOF_HGE :
+#endif
+                   SIZEOF_LNG) < 0 ||
            OIDwrite(f) < 0 ||
            fprintf(f, " BBPsize=%d\n", n) < 0 ||
            ferror(f))
@@ -1872,6 +1886,11 @@ BBPinsert(BATstore *bs)
        BBP_refs(i) = 1;        /* new bats have 1 pin */
        BBP_lrefs(i) = 0;       /* ie. no logical refs */
 
+#ifdef HAVE_HGE
+       if (bs->T.type == TYPE_hge)
+               havehge = 1;
+#endif
+
        if (BBP_bak(i) == NULL) {
                s = BBPtmpname(dirname, 64, i);
                BBP_logical(i) = GDKstrdup(s);
diff --git a/sql/storage/bat/bat_utils.c b/sql/storage/bat/bat_utils.c
--- a/sql/storage/bat/bat_utils.c
+++ b/sql/storage/bat/bat_utils.c
@@ -8,6 +8,7 @@
 
 #include "monetdb_config.h"
 #include "bat_utils.h"
+#include "mal.h"               /* for have_hge */
 
 void
 bat_destroy(BAT *b)
@@ -174,7 +175,11 @@ bat_utils_init(void)
        int t;
 
        for (t=1; t<GDKatomcnt; t++) {
-               if (t != TYPE_bat && BATatoms[t].name[0]) {
+               if (t != TYPE_bat && BATatoms[t].name[0]
+#ifdef HAVE_HGE
+                   && (have_hge || t != TYPE_hge)
+#endif
+               ) {
                        ebats[t] = bat_new(TYPE_void, t, 0, TRANSIENT);
                        bat_set_access(ebats[t], BAT_READ);
                }
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to