Changeset: 4f2634e5acf8 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4f2634e5acf8
Modified Files:
        monetdb5/modules/mosaic/mosaic.c
Branch: mosaic
Log Message:

Fix heap management in MOSlayout.


diffs (63 lines):

diff --git a/monetdb5/modules/mosaic/mosaic.c b/monetdb5/modules/mosaic/mosaic.c
--- a/monetdb5/modules/mosaic/mosaic.c
+++ b/monetdb5/modules/mosaic/mosaic.c
@@ -12,6 +12,7 @@
  * The permissible compression MOSmethods can be controlled thru an argument 
list
 */
 
+
 #include "monetdb_config.h"
 #include "mosaic.h"
 #include "mosaic_hdr.h"
@@ -300,11 +301,27 @@ MOSlayout_hdr(MOStask* task, MosaicLayou
        return MAL_SUCCEED;
 }
 
+// The remainders is cloned from the generator code base
+// overload the algebra functions to check for compressed heaps.
+static int // TODO make boolean
+isCompressed(bat bid)
+{
+       BAT *b;
+       int r=0;
+       if( bid == 0)
+               return 0;
+       b = BATdescriptor(bid);
+
+       r = BATcheckmosaic(b);
+       BBPunfix(bid);
+       return r;
+}
+
 str
 MOSlayout(BAT *b, BAT *bbsn, BAT *btech, BAT *bcount, BAT *binput, BAT 
*boutput, BAT *bproperties) {
        str msg = MAL_SUCCEED;
 
-       if( b->tmosaic == NULL)
+       if( !isCompressed(b->batCacheid))
                throw(MAL,"mosaic.layout","Compression heap missing");
 
        MOStask task = {0};
@@ -694,22 +711,6 @@ MOSdecompress(bat* ret, const bat* bid)
        return result;
 }
 
-// The remainders is cloned from the generator code base
-// overload the algebra functions to check for compressed heaps.
-static int // TODO make boolean
-isCompressed(bat bid)
-{
-       BAT *b;
-       int r=0;
-       if( bid == 0)
-               return 0;
-       b = BATdescriptor(bid);
-
-       r = BATcheckmosaic(b);
-       BBPunfix(bid);
-       return r;
-}
-
 /* The algebra operators should fall back to their default
  * when we know that the heap is not compressed
  * The actual decompression should wait until we know that
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to