Commit 4ac47930 authored by yiwenshao's avatar yiwenshao

add comments

parent 7201cb3c
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
#oAGG: HOM #oAGG: HOM
#oASHE: ASHE #oASHE: ASHE
[onions for num] [onions for num]
oDET: DET RND #oDET: DET RND
oOPE: OPE RND #oOPE: OPE RND
#oAGG: HOM oAGG: HOM
oASHE: ASHE #oASHE: ASHE
[end] [end]
......
...@@ -230,33 +230,24 @@ EncLayerFactory::deserializeLayer(unsigned int id, ...@@ -230,33 +230,24 @@ EncLayerFactory::deserializeLayer(unsigned int id,
const std::string &serial){ const std::string &serial){
assert(id); assert(id);
const SerialLayer li = serial_unpack(serial); const SerialLayer li = serial_unpack(serial);
switch (li.l) { switch (li.l) {
case SECLEVEL::RND: case SECLEVEL::RND:
return RNDFactory::deserialize(id, li); return RNDFactory::deserialize(id, li);
case SECLEVEL::DET: case SECLEVEL::DET:
return DETFactory::deserialize(id, li); return DETFactory::deserialize(id, li);
case SECLEVEL::DETJOIN: case SECLEVEL::DETJOIN:
return DETJOINFactory::deserialize(id, li); return DETJOINFactory::deserialize(id, li);
case SECLEVEL::OPEFOREIGN: case SECLEVEL::OPEFOREIGN:
return OPEFOREIGNFactory::deserialize(id,li); return OPEFOREIGNFactory::deserialize(id,li);
case SECLEVEL::OPE: case SECLEVEL::OPE:
return OPEFactory::deserialize(id, li); return OPEFactory::deserialize(id, li);
case SECLEVEL::HOM: case SECLEVEL::HOM:
return std::unique_ptr<EncLayer>(new HOM(id, serial)); return std::unique_ptr<EncLayer>(new HOM(id, serial));
case SECLEVEL::ASHE: return std::unique_ptr<EncLayer>(new ASHE(id, serial)); case SECLEVEL::ASHE: return std::unique_ptr<EncLayer>(new ASHE(id, serial));
case SECLEVEL::SEARCH: case SECLEVEL::SEARCH:
return std::unique_ptr<EncLayer>(new Search(id, serial)); return std::unique_ptr<EncLayer>(new Search(id, serial));
case SECLEVEL::PLAINVAL: case SECLEVEL::PLAINVAL:
return std::unique_ptr<EncLayer>(new PlainText(id)); return std::unique_ptr<EncLayer>(new PlainText(id));
default:{} default:{}
} }
FAIL_TextMessageError("unknown or unimplemented security level"); FAIL_TextMessageError("unknown or unimplemented security level");
...@@ -286,7 +277,6 @@ lowLevelcreateFieldHelper(const Create_field &f, ...@@ -286,7 +277,6 @@ lowLevelcreateFieldHelper(const Create_field &f,
const std::string &anonname = "", const std::string &anonname = "",
CHARSET_INFO * const charset = NULL) CHARSET_INFO * const charset = NULL)
{ {
//从内存分配新的Create_field
const THD * const thd = current_thd; const THD * const thd = current_thd;
Create_field * const f0 = f.clone(thd->mem_root); Create_field * const f0 = f.clone(thd->mem_root);
f0->length = field_length; f0->length = field_length;
......
...@@ -109,6 +109,10 @@ std::string OnionMeta::getAnonOnionName() const{ ...@@ -109,6 +109,10 @@ std::string OnionMeta::getAnonOnionName() const{
return onionname; return onionname;
} }
/*
*Called by loadchildren.The deserialHelper uses the deserializer of the Enclayers to recover them, and the
*DBMeta::doFetchChildren reads raw data from embedded MySQL.
*/
std::vector<DBMeta *> std::vector<DBMeta *>
OnionMeta::fetchChildren(const std::unique_ptr<Connect> &e_conn){ OnionMeta::fetchChildren(const std::unique_ptr<Connect> &e_conn){
std::function<DBMeta *(const std::string &, std::function<DBMeta *(const std::string &,
......
...@@ -22,7 +22,7 @@ int main() { ...@@ -22,7 +22,7 @@ int main() {
} }
embeddedDir = std::string(buffer)+"/shadow"; embeddedDir = std::string(buffer)+"/shadow";
free(buffer); free(buffer);
// init_mysql(embeddedDir); init_mysql(embeddedDir);
std::string filename = std::string(cryptdb_dir)+"/test_parser/"+"template"; std::string filename = std::string(cryptdb_dir)+"/test_parser/"+"template";
std::string line="show databases;"; std::string line="show databases;";
std::unique_ptr<query_parse> p; std::unique_ptr<query_parse> p;
......
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