Changeset: df00ed13134f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=df00ed13134f
Modified Files:
monetdb5/modules/mosaic/mosaic.c
monetdb5/modules/mosaic/mosaic_dictionary.h
Branch: mosaic
Log Message:
Fix illegal postestimate and improper error handling.
diffs (59 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
@@ -289,7 +289,7 @@ MOSprepareEstimate(MOStask* task) {
if (msg != MAL_SUCCEED) return msg;\
}
-#define postEstimate(NAME, TPE, DUMMY_ARGUMENT)
MOSpostEstimate_##NAME##_##TPE(task);
+#define postEstimate(NAME, TPE, DUMMY_ARGUMENT) if (current->is_applicable) {
MOSpostEstimate_##NAME##_##TPE(task); }
#define MOSestimate_AND_MOSoptimizerCost_DEF(TPE) \
static str MOSestimate_inner_##TPE(MOStask* task, MosaicEstimation* current,
const MosaicEstimation* previous) {\
@@ -353,14 +353,14 @@ static str MOSestimate_inner_##TPE(MOSta
}\
}\
\
- if (current->compression_strategy.tag == MOSAIC_RAW)
DO_OPERATION_IF_ALLOWED(postEstimate, raw, TPE);\
- if (current->compression_strategy.tag == MOSAIC_RLE)
DO_OPERATION_IF_ALLOWED(postEstimate, runlength, TPE);\
+ if (current->compression_strategy.tag == MOSAIC_RAW)
DO_OPERATION_IF_ALLOWED(postEstimate, raw, TPE);\
+ if (current->compression_strategy.tag == MOSAIC_RLE)
DO_OPERATION_IF_ALLOWED(postEstimate, runlength, TPE);\
if (current->compression_strategy.tag == MOSAIC_DICT256)
DO_OPERATION_IF_ALLOWED(postEstimate, dict256, TPE);\
- if (current->compression_strategy.tag == MOSAIC_DICT)
DO_OPERATION_IF_ALLOWED(postEstimate, dict, TPE);\
- if (current->compression_strategy.tag == MOSAIC_DELTA)
DO_OPERATION_IF_ALLOWED(postEstimate, delta, TPE);\
- if (current->compression_strategy.tag == MOSAIC_LINEAR)
DO_OPERATION_IF_ALLOWED(postEstimate, linear, TPE);\
- if (current->compression_strategy.tag == MOSAIC_FRAME)
DO_OPERATION_IF_ALLOWED(postEstimate, frame, TPE);\
- if (current->compression_strategy.tag == MOSAIC_PREFIX)
DO_OPERATION_IF_ALLOWED(postEstimate, prefix, TPE);\
+ if (current->compression_strategy.tag == MOSAIC_DICT)
DO_OPERATION_IF_ALLOWED(postEstimate, dict, TPE);\
+ if (current->compression_strategy.tag == MOSAIC_DELTA)
DO_OPERATION_IF_ALLOWED(postEstimate, delta, TPE);\
+ if (current->compression_strategy.tag == MOSAIC_LINEAR)
DO_OPERATION_IF_ALLOWED(postEstimate, linear, TPE);\
+ if (current->compression_strategy.tag == MOSAIC_FRAME)
DO_OPERATION_IF_ALLOWED(postEstimate, frame, TPE);\
+ if (current->compression_strategy.tag == MOSAIC_PREFIX)
DO_OPERATION_IF_ALLOWED(postEstimate, prefix, TPE);\
\
return MAL_SUCCEED;\
}\
@@ -1481,7 +1481,8 @@ MOSAnalysis(BAT *b, BAT *btech, BAT *bou
if(msg != MAL_SUCCEED || b->tmosaic == NULL){
if (msg != MAL_SUCCEED) {
- GDKfree(msg);
+ freeException(msg);
+ msg = MAL_SUCCEED;
}
// aborted compression experiment
MOSdestroy(BBPdescriptor(bid));
diff --git a/monetdb5/modules/mosaic/mosaic_dictionary.h
b/monetdb5/modules/mosaic/mosaic_dictionary.h
--- a/monetdb5/modules/mosaic/mosaic_dictionary.h
+++ b/monetdb5/modules/mosaic/mosaic_dictionary.h
@@ -150,10 +150,7 @@ void merge_delta_Into_dictionary_##TPE(D
\
for (BUN i = 0; i < delta_count; i++) {\
BUN key = find_value_##TPE(dict, *dict_count, delta[i]);\
- if (key < *dict_count && ARE_EQUAL(dict[key], delta[i], nil,
TPE)) {\
- /*This delta value is already in the dictionary hence
we can skip it.*/\
- continue;\
- }\
+ assert(key == *dict_count || !ARE_EQUAL(dict[key], delta[i],
nil, TPE));\
insert_into_dict_##TPE(dict, dict_count, key, delta[i]);\
}\
GET_BITS(info) = GET_BITS_EXTENDED(info);\
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list