Commit f13bef30 authored by yiwenshao's avatar yiwenshao

almost finish simple load new

parent c6b2d2c1
...@@ -72,7 +72,7 @@ fullBackUp gfb; ...@@ -72,7 +72,7 @@ fullBackUp gfb;
static static
void void
load_columns(std::vector<FieldMetaTrans> &fmts,std::string db,std::string table){ load_columns(std::vector<FieldMetaTrans> &fmts,std::string db,std::string table) {
for(auto &item:fmts){ for(auto &item:fmts){
std::string prefix = std::string("data/")+db+"/"+table+"/" std::string prefix = std::string("data/")+db+"/"+table+"/"
+ item.getOriginalFieldMeta()->getFieldName()+"/"; + item.getOriginalFieldMeta()->getFieldName()+"/";
...@@ -99,8 +99,6 @@ load_columns(std::vector<FieldMetaTrans> &fmts,std::string db,std::string table) ...@@ -99,8 +99,6 @@ load_columns(std::vector<FieldMetaTrans> &fmts,std::string db,std::string table)
for(unsigned int i=0;i<gfb.field_names.size();i++){ for(unsigned int i=0;i<gfb.field_names.size();i++){
gfb.annoOnionNameToType[gfb.field_names[i]] = gfb.field_types[i]; gfb.annoOnionNameToType[gfb.field_names[i]] = gfb.field_types[i];
} }
} }
/*should choose the right decryption onion*/ /*should choose the right decryption onion*/
...@@ -130,14 +128,12 @@ std::shared_ptr<ReturnMeta> getReturnMeta(std::vector<FieldMeta*> fms, ...@@ -130,14 +128,12 @@ std::shared_ptr<ReturnMeta> getReturnMeta(std::vector<FieldMeta*> fms,
if(needsSalt(curOLK)) if(needsSalt(curOLK))
use_salt = true; use_salt = true;
addToReturn(myReturnMeta.get(),pos++,curOLK,use_salt,k->getFieldName()); addToReturn(myReturnMeta.get(),pos++,curOLK,use_salt,k->getFieldName());
if(use_salt) if(use_salt)
addSaltToReturn(myReturnMeta.get(),pos++); addSaltToReturn(myReturnMeta.get(),pos++);
//used to record choosen field lengths, onion names , and field types //used to record choosen field lengths, onion names , and field types
field_types.push_back(tfds[i].getChoosenFieldTypes()[index]); field_types.push_back(tfds[i].getChoosenFieldTypes()[index]);
field_names.push_back(tfds[i].getChoosenOnionName()[index]); field_names.push_back(tfds[i].getChoosenOnionName()[index]);
field_lengths.push_back(tfds[i].getChoosenFieldLengths()[index]); field_lengths.push_back(tfds[i].getChoosenFieldLengths()[index]);
if(use_salt){ if(use_salt){
field_types.push_back(tfds[i].getSaltType()); field_types.push_back(tfds[i].getSaltType());
field_names.push_back(tfds[i].getSaltName()); field_names.push_back(tfds[i].getSaltName());
...@@ -184,11 +180,8 @@ static ResType load_files_new(std::string db, std::string table){ ...@@ -184,11 +180,8 @@ static ResType load_files_new(std::string db, std::string table){
return ResType(false, 0, 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();
vector<vector<string>> ress_field; vector<vector<string>> ress_field;
for(unsigned int i=0u;i<length;i++){ for(unsigned int i=0u;i<length;i++){
vector<string> row; vector<string> row;
...@@ -314,7 +307,8 @@ main(int argc, char* argv[]){ ...@@ -314,7 +307,8 @@ main(int argc, char* argv[]){
std::string annoTableName = analysis.getTableMeta(db,table).getAnonTableName(); std::string annoTableName = analysis.getTableMeta(db,table).getAnonTableName();
const std::string head = std::string("INSERT INTO `")+db+"`.`"+annoTableName+"` "; const std::string head = std::string("INSERT INTO `")+db+"`.`"+annoTableName+"` ";
unsigned int i=0u; unsigned int i=0u;
while(true){ UNUSED(i);
/* while(true){
List<List_item> newList; List<List_item> newList;
int localCount=0; int localCount=0;
for(;i<res.rows.size();i++){ for(;i<res.rows.size();i++){
...@@ -339,7 +333,7 @@ main(int argc, char* argv[]){ ...@@ -339,7 +333,7 @@ main(int argc, char* argv[]){
} }
break; break;
} }
} }*/
UNUSED(load_files_new); UNUSED(load_files_new);
UNUSED(processRow); UNUSED(processRow);
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