刘学利测试DNS时发现,修复expr_plus类型配置更新时,相同district生成不同district_id的bug。该bug在20160627的修改时引入。

This commit is contained in:
zhengchao
2016-09-09 15:39:56 +08:00
parent 9db46a2e4c
commit 0d10172367
2 changed files with 13 additions and 6 deletions

View File

@@ -26,7 +26,7 @@
#include "mesa_fuzzy.h" #include "mesa_fuzzy.h"
#include "great_index_engine.h" #include "great_index_engine.h"
int MAAT_FRAME_VERSION_1_8_20160907_TABLE_CONJ=1; int MAAT_FRAME_VERSION_1_8_20160909_TABLE_CONJ=1;
const char *maat_module="MAAT Frame"; const char *maat_module="MAAT Frame";
const char* CHARSET_STRING[]={"NONE","gbk","big5","unicode","utf8","bin", const char* CHARSET_STRING[]={"NONE","gbk","big5","unicode","utf8","bin",
@@ -1357,10 +1357,14 @@ int get_district_id(_Maat_scanner_t *scanner,const char* district_str)
{ {
scanner->tmp_district_map=map_duplicate(scanner->district_map); scanner->tmp_district_map=map_duplicate(scanner->district_map);
} }
map_ret=map_str2int(scanner->tmp_district_map, district_str,&district_id);
if(map_ret<0)
{
district_id= scanner->district_num; district_id= scanner->district_num;
map_register(scanner->tmp_district_map,district_str, district_id); map_register(scanner->tmp_district_map,district_str, district_id);
scanner->district_num++; scanner->district_num++;
} }
}
return district_id; return district_id;
} }
int add_expr_rule(struct _Maat_table_info_t* table,struct db_str_rule_t* db_rule,struct _Maat_scanner_t *scanner,void* logger) int add_expr_rule(struct _Maat_table_info_t* table,struct db_str_rule_t* db_rule,struct _Maat_scanner_t *scanner,void* logger)

View File

@@ -4,10 +4,13 @@
CC = gcc CC = gcc
CCC = g++ CCC = g++
CFLAGS = -Wall -g -fPIC CFLAGS = -Wall -g -fPIC
GCOV_FLAGS = -fprofile-arcs -ftest-coverage
CFLAGS += $(OPTFLAGS) CFLAGS += $(OPTFLAGS)
#CFLAGS += $(GCOV_FLAGS)
LDDICTATOR = -Wl,-wrap,malloc -Wl,-wrap,calloc -Wl,-wrap,free -Wl,-wrap,realloc LDDICTATOR = -Wl,-wrap,malloc -Wl,-wrap,calloc -Wl,-wrap,free -Wl,-wrap,realloc
LDFLAGS = -lMESA_handle_logger -lMESA_htable -lpthread -lrt -lm -lrulescan -lpcre -lMESA_field_stat2 LDFLAGS = -lMESA_handle_logger -lMESA_htable -lpthread -lrt -lm -lrulescan -lpcre -lMESA_field_stat2 -lgcov
#LDFLAGS += $(LDDICTATOR) #LDFLAGS += $(LDDICTATOR)
LDFLAGS += $(GCOV_FLAGS)
MAILLIB = ../lib MAILLIB = ../lib
G_H_DIR =../inc_internal G_H_DIR =../inc_internal
@@ -34,7 +37,7 @@ $(LIBMAAT): $(OBJS)
cp $(LIBMAAT) ../../lib/ cp $(LIBMAAT) ../../lib/
clean: clean:
rm -rf *.o $(LIBMAAT) *~ rm -rf *.o *.gcov *.gcno $(LIBMAAT) *~
opt: opt:
$(MAKE) all $(MAKE) all