Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
Practical-Cryptdb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Zhaozhen
Practical-Cryptdb
Commits
0ee22c25
Commit
0ee22c25
authored
Jan 19, 2018
by
yiwenshao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
able to specify db and table, to be tested. and also, ASHE should be stronger
parent
88b96d60
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
final_load.cc
debug/final_load.cc
+4
-0
final_store.cc
debug/final_store.cc
+11
-2
No files found.
debug/final_load.cc
View file @
0ee22c25
...
@@ -252,6 +252,10 @@ main(int argc, char* argv[]){
...
@@ -252,6 +252,10 @@ main(int argc, char* argv[]){
init
();
init
();
create_embedded_thd
(
0
);
create_embedded_thd
(
0
);
std
::
string
db
=
"tdb"
,
table
=
"student"
;
std
::
string
db
=
"tdb"
,
table
=
"student"
;
if
(
argc
==
3
){
db
=
std
::
string
(
argv
[
1
]);
table
=
std
::
string
(
argv
[
2
]);
}
std
::
unique_ptr
<
SchemaInfo
>
schema
=
myLoadSchemaInfo
(
embeddedDir
);
std
::
unique_ptr
<
SchemaInfo
>
schema
=
myLoadSchemaInfo
(
embeddedDir
);
schema
.
get
();
schema
.
get
();
...
...
debug/final_store.cc
View file @
0ee22c25
...
@@ -47,6 +47,7 @@ std::string getTestQuery(SchemaInfo &schema, std::vector<FieldMetaTrans> &tfds,
...
@@ -47,6 +47,7 @@ std::string getTestQuery(SchemaInfo &schema, std::vector<FieldMetaTrans> &tfds,
res
+=
item
;
res
+=
item
;
res
+=
" , "
;
res
+=
" , "
;
}
}
//actually the salt should be selected if RND is used,this should be changed later.
if
(
tf
.
getHasSalt
()){
if
(
tf
.
getHasSalt
()){
res
+=
tf
.
getSaltName
()
+
" , "
;
res
+=
tf
.
getSaltName
()
+
" , "
;
}
}
...
@@ -82,10 +83,13 @@ static void store(std::string db, std::string table){
...
@@ -82,10 +83,13 @@ static void store(std::string db, std::string table){
res
.
push_back
(
ft
);
res
.
push_back
(
ft
);
res
.
back
().
trans
(
fms
[
i
]);
res
.
back
().
trans
(
fms
[
i
]);
}
}
/*this is our strategy, each field should be able to choose the selected onion*/
storeStrategies
(
res
);
storeStrategies
(
res
);
//generate the backup query and then fetch the tuples
//generate the backup query and then fetch the tuples
std
::
string
backup_query
=
getTestQuery
(
*
schema
,
res
,
db
,
table
);
std
::
string
backup_query
=
getTestQuery
(
*
schema
,
res
,
db
,
table
);
rawMySQLReturnValue
resraw
=
executeAndGetResultRemote
(
globalConn
,
backup_query
);
rawMySQLReturnValue
resraw
=
executeAndGetResultRemote
(
globalConn
,
backup_query
);
//then we should set the type and length of FieldMetaTrans
//then we should set the type and length of FieldMetaTrans
...
@@ -102,19 +106,24 @@ static void store(std::string db, std::string table){
...
@@ -102,19 +106,24 @@ static void store(std::string db, std::string table){
}
}
item
.
setChoosenFieldTypes
(
tempTypes
);
item
.
setChoosenFieldTypes
(
tempTypes
);
item
.
setChoosenFieldLengths
(
tempLengths
);
item
.
setChoosenFieldLengths
(
tempLengths
);
if
(
item
.
getHasSalt
()){
if
(
item
.
getHasSalt
()){
//also this should be changed.
item
.
setSaltType
(
types
[
base_types
++
]);
item
.
setSaltType
(
types
[
base_types
++
]);
item
.
setSaltLength
(
lengths
[
base_lengths
++
]);
item
.
setSaltLength
(
lengths
[
base_lengths
++
]);
}
}
}
}
//write the tuples into files
//write the tuples into files
write_raw_data_to_files
(
resraw
,
res
,
db
,
table
);
write_raw_data_to_files
(
resraw
,
res
,
db
,
table
);
}
}
int
int
main
(
int
argc
,
char
*
argv
[]){
main
(
int
argc
,
char
*
argv
[]){
init
();
init
();
std
::
string
db
=
"tdb"
,
table
=
"student"
;
std
::
string
db
=
"tdb"
,
table
=
"student"
;
if
(
argc
==
3
){
db
=
std
::
string
(
argv
[
1
]);
table
=
std
::
string
(
argv
[
2
]);
}
store
(
db
,
table
);
store
(
db
,
table
);
return
0
;
return
0
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment