改进conjunction功能的错误日志,增加测试用例,自测通过。

This commit is contained in:
zhengchao
2016-08-30 11:08:32 +08:00
parent 86832693d6
commit 5e2a23568b
5 changed files with 89 additions and 6 deletions

View File

@@ -426,7 +426,7 @@ Maat_feather_t Maat_feather(int max_thread_num,const char* table_info_path,void*
{
feather->GROUP_MODE_ON=1;
}
for(j=0;j<feather->p_table_info[i].conj_cnt;j++)
for(j=0;j<feather->p_table_info[i]->conj_cnt;j++)
{
ret=map_register(feather->map_tablename2id,feather->p_table_info[i]->table_name[j],feather->p_table_info[i]->table_id);
if(ret<0)

View File

@@ -552,7 +552,7 @@ int read_table_info(struct _Maat_table_info_t** p_table_info,int num,const char*
}
if(p->table_id>=num)
{
fprintf(stderr,"Maat read table info %s line %d error: table id %uh > %d.\n",table_info_path,i,p->table_id,num);
fprintf(stderr,"Maat read table info %s:%d error: table id %uh > %d.\n",table_info_path,i,p->table_id,num);
MESA_handle_runtime_log(logger, RLOG_LV_FATAL,maat_module,
"Maat read table info %s line %d error: table id %uh > %d.\n",table_info_path,i,p->table_id,num);
@@ -571,7 +571,7 @@ int read_table_info(struct _Maat_table_info_t** p_table_info,int num,const char*
memcpy(conj_table->table_name[conj_table->conj_cnt],p->table_name[0],MAX_TABLE_NAME_LEN);
conj_table->conj_cnt++;
MESA_handle_runtime_log(logger, RLOG_LV_INFO,maat_module,
"Maat read table info %s line %d error:conjunction %s with %s (id=%d,total=%d).\n"
"Maat read table info %s:%d:conjunction %s with %s (id=%d,total=%d).\n"
,table_info_path,i,p->table_name[0]
,conj_table->table_name[0],conj_table->table_id,conj_table->conj_cnt);
//use goto to free the conjunctioned table_info
@@ -2687,12 +2687,12 @@ void maat_update_cb(const char* table_name,const char* line,void *u_para)
p_table=feather->p_table_info[table_id];
for(i=0;i<p_table->conj_cnt;i++)
{
if(0==memcmp(p_table->table_name[i],table_name,strlen(table_name))
if(0==memcmp(p_table->table_name[i],table_name,strlen(table_name)))
{
p_table->updating_name=i;
}
}
assert(i<p_table->conj_cnt);
assert(i<=p_table->conj_cnt);
switch(feather->p_table_info[table_id]->table_type)
{

View File

@@ -28,7 +28,7 @@ void maat_stat_init(struct _Maat_feather_t* feather)
int value=0;
int i=0,j=0,offset=0;
struct _Maat_table_info_t* p_table=NULL;
char conj_table_name[(MAX_TABLE_NAME_LEN+1)*MAX_CONJUNCTION_TABLE_NUM]={0}
char conj_table_name[(MAX_TABLE_NAME_LEN+1)*MAX_CONJUNCTION_TABLE_NUM]={0};
feather->stat_handle=FS_create_handle();
FS_set_para(feather->stat_handle, OUTPUT_DEVICE, feather->stat_file, strlen(feather->stat_file)+1);