Changeset: 081adf4e0b90 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=081adf4e0b90
Modified Files:
        gdk/gdk.h
        gdk/gdk_bbp.c
Branch: mosaic
Log Message:

Save heap compression flag in BBP.


diffs (52 lines):

diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -971,7 +971,8 @@ typedef struct {
 #define assert_shift_width(shift,width) assert(((shift) == 0 && (width) == 0) 
|| ((unsigned)1<<(shift)) == (unsigned)(width))
 
 #define GDKLIBRARY_64_BIT_INT  061026  /* version that had no 128-bit integer 
option, yet */
-#define GDKLIBRARY             061027
+#define GDKLIBRARY_NOCOMPRESS  061027  /* version without compression (mosaic) 
*/
+#define GDKLIBRARY             061030
 
 typedef struct BAT {
        /* static bat properties */
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -725,7 +725,7 @@ heapinit(COLrec *col, const char *buf, i
                   &n) < 13)
                GDKfatal("BBPinit: invalid format for BBP.dir\n%s", buf);
 
-       if (properties & ~0x0F81)
+       if (properties & ~0x1F81)
                GDKfatal("BBPinit: unknown properties are set: incompatible 
database\n");
        *hashash = var & 2;
        var &= ~2;
@@ -762,6 +762,9 @@ heapinit(COLrec *col, const char *buf, i
        col->dense = (properties & 0x0200) != 0;
        col->nonil = (properties & 0x0400) != 0;
        col->nil = (properties & 0x0800) != 0;
+       if ((col->heap.compressed = (properties & 0x1000) != 0) != 0 &&
+           bbpversion <= GDKLIBRARY_NOCOMPRESS)
+               GDKfatal("BBPinit: inconsistent entry in BBP.dir: compression 
flag set in version without compression\n");
        col->nosorted = (BUN) nosorted;
        col->norevsorted = (BUN) norevsorted;
        col->seq = base < 0 ? oid_nil : (oid) base;
@@ -957,6 +960,7 @@ BBPheader(FILE *fp, oid *BBPoid, int *OI
                exit(1);
        }
        if (bbpversion != GDKLIBRARY &&
+           bbpversion != GDKLIBRARY_NOCOMPRESS &&
            bbpversion != GDKLIBRARY_64_BIT_INT) {
                GDKfatal("BBPinit: incompatible BBP version: expected 0%o, got 
0%o.", GDKLIBRARY, bbpversion);
        }
@@ -1232,7 +1236,7 @@ heap_entry(stream *s, COLrec *col)
                          t >= 0 ? BATatoms[t].name : ATOMunknown_name(t),
                          col->width,
                          col->varsized | (col->vheap ? col->vheap->hashash << 
1 : 0),
-                        (unsigned short) col->sorted | ((unsigned short) 
col->revsorted << 7) | (((unsigned short) col->key & 0x01) << 8) | ((unsigned 
short) col->dense << 9) | ((unsigned short) col->nonil << 10) | ((unsigned 
short) col->nil << 11),
+                        (unsigned short) col->sorted | ((unsigned short) 
col->revsorted << 7) | (((unsigned short) col->key & 0x01) << 8) | ((unsigned 
short) col->dense << 9) | ((unsigned short) col->nonil << 10) | ((unsigned 
short) col->nil << 11) | ((unsigned short) col->heap.compressed << 12),
                          col->nokey[0],
                          col->nokey[1],
                          col->nosorted,
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to