Commit 6a60ba78 authored by casualet's avatar casualet

able to decrypt multiple rows

parent b7875b36
...@@ -539,19 +539,26 @@ main() { ...@@ -539,19 +539,26 @@ main() {
continue; continue;
} }
if(curQuery=="back"){ if(curQuery=="back"){
std::string db,table;
std::cout<<"please input dbname "<<std::endl;
cin>>db;
std::cout<<"please input table name "<<std::endl;
cin>>table;
std::unique_ptr<SchemaInfo> schema = myLoadSchemaInfo(); std::unique_ptr<SchemaInfo> schema = myLoadSchemaInfo();
std::vector<FieldMeta*> fms = getFieldMeta(*schema); std::vector<FieldMeta*> fms = getFieldMeta(*schema,db,table);
auto res = getTransField(fms); auto res = getTransField(fms);
for(auto &item:res){ for(auto &item:res){
break;
item.show(); item.show();
} }
std::shared_ptr<ReturnMeta> rm = getReturnMeta(fms,res); std::shared_ptr<ReturnMeta> rm = getReturnMeta(fms,res);
std::string backq = getBackupQuery(*schema,res); std::string backq = getBackupQuery(*schema,res,db,table);
rawReturnValue resraw = executeAndGetResultRemote(globalConn,backq); rawReturnValue resraw = executeAndGetResultRemote(globalConn,backq);
//printrawReturnValue(resraw); //printrawReturnValue(resraw);
ResType rawtorestype = MygetResTypeFromLuaTable(false, &resraw); ResType rawtorestype = MygetResTypeFromLuaTable(false, &resraw);
auto finalresults = decryptResults(rawtorestype,*rm); auto finalresults = decryptResults(rawtorestype,*rm);
parseResType(finalresults); parseResType(finalresults);
} }
std::cout<<GREEN_BEGIN<<"\nplease input a new query:#######"<<COLOR_END<<std::endl; std::cout<<GREEN_BEGIN<<"\nplease input a new query:#######"<<COLOR_END<<std::endl;
std::getline(std::cin,curQuery); std::getline(std::cin,curQuery);
......
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