diff --git a/inc/bool_matcher.h b/inc/bool_matcher.h index 20cde6d..08df846 100644 --- a/inc/bool_matcher.h +++ b/inc/bool_matcher.h @@ -52,7 +52,7 @@ extern "C" struct bool_matcher * bool_matcher_new(struct bool_expr * exprs, size_t expr_num, unsigned int max_thread_num, size_t * mem_size); /* Returned results are sorted by expr_id in descending order. */ - /* 本函数将对数组item_ids进行排序,会改变item_ids中元素的顺序 */ + //Input item_ids MUST be ASCENDING order and NO duplication. int bool_matcher_match(struct bool_matcher * matcher, unsigned int thread_id, unsigned long long * item_ids, size_t item_num, struct bool_expr_match * results, size_t n_result); void bool_matcher_free(struct bool_matcher * matcher); diff --git a/src/entry/Maat_hierarchy.cpp b/src/entry/Maat_hierarchy.cpp index ede86e4..d4e4b84 100644 --- a/src/entry/Maat_hierarchy.cpp +++ b/src/entry/Maat_hierarchy.cpp @@ -331,7 +331,7 @@ static void Maat_hierarchy_region_free(struct Maat_hierarchy* hier, struct Maat_ struct Maat_hierarchy* Maat_hierarchy_new(int thread_num, void* mesa_handle_logger, struct Maat_garbage_bin* bin) { struct Maat_hierarchy* hier=ALLOC(struct Maat_hierarchy, 1); - int ret=0; + UNUSED int ret=0; hier->logger=mesa_handle_logger; hier->thread_num=thread_num; hier->version=time(NULL); diff --git a/src/entry/Maat_rule.cpp b/src/entry/Maat_rule.cpp index 9db757e..1098b95 100644 --- a/src/entry/Maat_rule.cpp +++ b/src/entry/Maat_rule.cpp @@ -57,7 +57,7 @@ extern "C" } #endif -int MAAT_FRAME_VERSION_3_2_1_20210613=1; +int MAAT_FRAME_VERSION_3_2_2_20210629=1; int is_valid_table_name(const char* str) { @@ -1425,7 +1425,7 @@ int del_region_rule(struct Maat_table_schema* table, int region_id, int group_id struct Maat_table_runtime* table_rt=NULL; struct op_expr_t* op_expr=NULL; - int ret=0; + UNUSED int ret=0; struct Maat_region_inner* region=NULL; region=(struct Maat_region_inner*)Maat_hierarchy_region_dettach_user_data(maat_scanner->hier, region_id); if(region==NULL) diff --git a/src/entry/bool_matcher.cpp b/src/entry/bool_matcher.cpp index 5ca3461..cabc552 100644 --- a/src/entry/bool_matcher.cpp +++ b/src/entry/bool_matcher.cpp @@ -150,13 +150,13 @@ int bool_matcher_match(struct bool_matcher * matcher, unsigned int thread_id, un if(matcher==NULL) return -1; if(item_num==0) return 0; - sort(item_ids, item_ids+item_num); - size_t J=0; - for(unsigned int i=1; i +using namespace std; #include #include #include @@ -92,6 +93,7 @@ TEST(BoolMatcher, Match) input_item_ids[input_item_num]=random(); input_item_num++; } + sort(input_item_ids, input_item_ids+input_item_num); ret=bool_matcher_match(bm, 1, input_item_ids, input_item_num, result_array, 1024); if(ret>0) { @@ -116,6 +118,7 @@ TEST(BoolMatcher, Match) input_item_ids[14]=222; input_item_ids[15]=333; input_item_num=8; + sort(input_item_ids, input_item_ids+input_item_num); for(i=0; i