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

Set BAT writable before compressing so that a backup gets made.


diffs (24 lines):

diff --git a/monetdb5/modules/mal/mosaic.c b/monetdb5/modules/mal/mosaic.c
--- a/monetdb5/modules/mal/mosaic.c
+++ b/monetdb5/modules/mal/mosaic.c
@@ -244,6 +244,11 @@ MOScompressInternal(Client cntxt, bat *r
                // It should always take less space than the orginal column.
                // But be prepared that a header and last block header may  be 
stored
                // use a size overshoot. Also be aware of possible dictionary 
headers
+               if (BATsetaccess(bcompress, BAT_WRITE) == NULL) {
+                       BBPreleaseref(bsrc->batCacheid);
+                       BBPreleaseref(bcompress->batCacheid);
+                       throw(MAL, "mosaic.compress", GDK_EXCEPTION);
+               }
                bcompress = BATextend(bcompress, 
BATgrows(bcompress)+MosaicHdrSize);
                if( bcompress == NULL){
                        BBPreleaseref(bsrc->batCacheid);
@@ -445,7 +450,7 @@ MOScompressInternal(Client cntxt, bat *r
                bcompress->T->heap.free = (size_t) (task->dst - 
Tloc(bcompress,BUNfirst(bcompress)) );
                bcompress->T->heap.compressed= 1;
                MCexitMaintenance(cntxt);
-               BATsave(bcompress);
+               BATsetaccess(bcompress, BAT_READ);
                BBPkeepref(*ret = bcompress->batCacheid);
                BBPreleaseref(bsrc->batCacheid);
        } else {
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to