diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c220b0f..373448c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,7 +3,7 @@ project(maatframe) set(MAAT_FRAME_MAJOR_VERSION 2) set(MAAT_FRAME_MINOR_VERSION 3) -set(MAAT_FRAME_PATCH_VERSION 20181025) +set(MAAT_FRAME_PATCH_VERSION 20181026) set(MAAT_FRAME_VERSION ${MAAT_FRAME_MAJOR_VERSION}.${MAAT_FRAME_MINOR_VERSION}.${MAAT_FRAME_PATCH_VERSION}) message(STATUS "Maat Frame, Version: ${MAAT_FRAME_VERSION}") diff --git a/src/entry/Maat_command.cpp b/src/entry/Maat_command.cpp index d900913..63fd2f6 100644 --- a/src/entry/Maat_command.cpp +++ b/src/entry/Maat_command.cpp @@ -391,7 +391,7 @@ int get_inc_key_list(long long instance_version, long long target_version, redis for(i=0, j=0;ielements;i++) { assert(reply->element[i]->type==REDIS_REPLY_STRING); - ret=sscanf(reply->element[i]->str,"%[^,],%[^,],%d",op_str,s_rule[j].table_name,&(s_rule[j].rule_id)); + ret=sscanf(reply->element[i]->str,"%[^,],%[^,],%ld",op_str,s_rule[j].table_name,&(s_rule[j].rule_id)); if(ret!=3||s_rule[i].rule_id<0) { MESA_handle_runtime_log(logger, RLOG_LV_FATAL, maat_redis_monitor, @@ -464,14 +464,14 @@ int recovery_history_version(const struct serial_rule_t* current, int current_nu for(i=0;i0); } for(i=changed_num-1;i>=0;i--) { - snprintf(hkey,sizeof(hkey),"%d,%s",changed[i].rule_id,changed[i].table_name); + snprintf(hkey,sizeof(hkey),"%ld,%s",changed[i].rule_id,changed[i].table_name); if(changed[i].op==MAAT_OP_ADD)//newly added rule is need to delete from current, so that history version can be recovered. { ret=MESA_htable_del(htable, (uchar*)hkey, strlen(hkey), NULL); @@ -643,7 +643,7 @@ FULL_UPDATE: "Invalid Redis Key Type: %d", sub_reply->element[i]->type); continue; } - ret=sscanf(sub_reply->element[i]->str,"%*[^:]:%[^,],%d",s_rule_array[full_idx].table_name,&(s_rule_array[full_idx].rule_id)); + ret=sscanf(sub_reply->element[i]->str,"%*[^:]:%[^,],%ld",s_rule_array[full_idx].table_name,&(s_rule_array[full_idx].rule_id)); s_rule_array[full_idx].op=MAAT_OP_ADD; if(ret!=2||s_rule_array[full_idx].rule_id<0||strlen(s_rule_array[full_idx].table_name)==0) { @@ -699,7 +699,7 @@ int _get_maat_redis_value(redisContext *c,struct serial_rule_t* rule_list,int ru redisReply* reply=NULL; for(i=0;ielement[i]->str,"%[^,],%d",s_rule[i].table_name,&(s_rule[i].rule_id)); + ret=sscanf(data_reply->element[i]->str,"%[^,],%ld",s_rule[i].table_name,&(s_rule[i].rule_id)); assert(ret==2); } freeReplyObject(data_reply); diff --git a/src/entry/Maat_rule.cpp b/src/entry/Maat_rule.cpp index 810b0e5..f6bda98 100644 --- a/src/entry/Maat_rule.cpp +++ b/src/entry/Maat_rule.cpp @@ -32,7 +32,7 @@ #include "stream_fuzzy_hash.h" #include "gram_index_engine.h" -int MAAT_FRAME_VERSION_2_2_20181025=1; +int MAAT_FRAME_VERSION_2_2_20181026=1; const char* CHARSET_STRING[]={"NONE","gbk","big5","unicode","utf8","bin", "unicode_ascii_esc","unicode_ascii_aligned","unicode_ncr_dec","unicode_ncr_hex","url_encode_gb2312","url_encode_utf8",""}; diff --git a/src/inc_internal/Maat_rule_internal.h b/src/inc_internal/Maat_rule_internal.h index 55bb52d..7ce5d08 100644 --- a/src/inc_internal/Maat_rule_internal.h +++ b/src/inc_internal/Maat_rule_internal.h @@ -470,7 +470,7 @@ struct foreign_key struct serial_rule_t //rm= Redis Maat { enum MAAT_OPERATION op;//0: delete, 1: add. - int rule_id; + long rule_id; int label_id; long long timeout; // absolute unix time. char table_name[256];