Commit 9fb94e3e authored by yiwenshao's avatar yiwenshao

fix bug in debug/final_load

parent 695a0163
...@@ -200,8 +200,7 @@ static ResType load_files(std::string db, std::string table){ ...@@ -200,8 +200,7 @@ static ResType load_files(std::string db, std::string table){
std::vector<FieldMetaTrans> res = res_meta.getFts(); std::vector<FieldMetaTrans> res = res_meta.getFts();
for(unsigned int i=0;i<fms.size();i++){ for(unsigned int i=0;i<fms.size();i++){
res[i].trans(fms[i]); res[i].trans(fms[i]);
} }
glog<<"loadtablemeta: "<< glog<<"loadtablemeta: "<<
std::to_string(t_load_files.lap()/1000000u)<< std::to_string(t_load_files.lap()/1000000u)<<
"##"<<std::to_string(time(NULL))<<"\n"; "##"<<std::to_string(time(NULL))<<"\n";
...@@ -228,6 +227,14 @@ static ResType load_files(std::string db, std::string table){ ...@@ -228,6 +227,14 @@ static ResType load_files(std::string db, std::string table){
for(auto item:field_names){ for(auto item:field_names){
res_field.push_back(gfb.annoOnionNameToFileVector[item]); res_field.push_back(gfb.annoOnionNameToFileVector[item]);
} }
//check here
for(auto item:res_field){
if(item.size()==0) {
return ResType(false, 0, 0);
}
}
//then transform it to ress_fields //then transform it to ress_fields
unsigned int length = res_field[0].size(); unsigned int length = res_field[0].size();
...@@ -362,7 +369,10 @@ main(int argc, char* argv[]){ ...@@ -362,7 +369,10 @@ main(int argc, char* argv[]){
/*choose decryption onion, load and decrypt to plain text*/ /*choose decryption onion, load and decrypt to plain text*/
ResType res = load_files(db,table); ResType res = load_files(db,table);
if(!res.success()){
glog<<"empty table \n";
return 0;
}
glog<<"load_files: "<< glog<<"load_files: "<<
std::to_string(t_init.lap()/1000000u)<< std::to_string(t_init.lap()/1000000u)<<
"##"<<std::to_string(time(NULL))<<"\n"; "##"<<std::to_string(time(NULL))<<"\n";
...@@ -408,7 +418,7 @@ main(int argc, char* argv[]){ ...@@ -408,7 +418,7 @@ main(int argc, char* argv[]){
glog<<"onionComputed: "<< glog<<"onionComputed: "<<
TypeText<onion>::toText(item.first)<<"::"<< TypeText<onion>::toText(item.first)<<"::"<<
std::to_string(item.second)<<"\n"; std::to_string(item.second)<<"\n";
} }
return 0; return 0;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment