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
3eacdd96
Commit
3eacdd96
authored
Oct 18, 2017
by
Casualet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
able write data and read data
parent
80b82eb3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
19 deletions
+16
-19
mbk.cc
main/mbk.cc
+16
-19
No files found.
main/mbk.cc
View file @
3eacdd96
...
@@ -188,7 +188,7 @@ rawReturnValue executeAndGetResultRemote(Connect * curConn,std::string query){
...
@@ -188,7 +188,7 @@ rawReturnValue executeAndGetResultRemote(Connect * curConn,std::string query){
//myRaw.lengths.push_back(fieldLen[i]);
//myRaw.lengths.push_back(fieldLen[i]);
myRaw
.
lengths
.
push_back
(
field
->
max_length
);
myRaw
.
lengths
.
push_back
(
field
->
max_length
);
myRaw
.
maxlengths
.
push_back
(
field
->
max_length
);
myRaw
.
maxlengths
.
push_back
(
field
->
max_length
);
cout
<<
field
->
length
<<
"::"
<<
field
->
max_length
<<
endl
;
//
cout<<field->length<<"::"<<field->max_length<<endl;
}
}
}
}
if
(
row
[
i
]
==
NULL
)
curRow
.
push_back
(
"NULL"
);
if
(
row
[
i
]
==
NULL
)
curRow
.
push_back
(
"NULL"
);
...
@@ -1261,25 +1261,22 @@ main(int argc, char* argv[]) {
...
@@ -1261,25 +1261,22 @@ main(int argc, char* argv[]) {
}
}
analyseCost
(
*
schema
,
res
,
db
,
table
);
analyseCost
(
*
schema
,
res
,
db
,
table
);
}
else
if
(
string
(
argv
[
3
])
==
"9"
){
}
else
if
(
string
(
argv
[
3
])
==
"9"
){
meta_file
res_meta
=
load_meta
();
//back up data
vector
<
vector
<
string
>>
res_field
=
load_table_fields
(
res_meta
);
std
::
string
db
=
"tdb"
,
table
=
"student"
;
std
::
string
db
=
"tdb"
,
table
=
"student"
;
std
::
unique_ptr
<
SchemaInfo
>
schema
=
myLoadSchemaInfo
();
std
::
unique_ptr
<
SchemaInfo
>
schema
=
myLoadSchemaInfo
();
//get all the fields in the tables.
//get all the fields in the tables.
std
::
vector
<
FieldMeta
*>
fms
=
getFieldMeta
(
*
schema
,
db
,
table
);
std
::
vector
<
FieldMeta
*>
fms
=
getFieldMeta
(
*
schema
,
db
,
table
);
auto
res
=
getTransField
(
fms
);
auto
res
=
getTransField
(
fms
);
for
(
auto
&
item
:
res
){
for
(
auto
&
item
:
res
){
item
.
choosenOnions
.
push_back
(
0
);
item
.
choosenOnions
.
push_back
(
0
);
}
}
std
::
shared_ptr
<
ReturnMeta
>
rm
=
getReturnMeta
(
fms
,
res
);
std
::
shared_ptr
<
ReturnMeta
>
rm
=
getReturnMeta
(
fms
,
res
);
rawReturnValue
resraw
;
std
::
string
backq
=
getTestQuery
(
*
schema
,
res
,
db
,
table
);
resraw
.
rowValues
=
res_field
;
rawReturnValue
resraw
=
executeAndGetResultRemote
(
globalConn
,
backq
);
resraw
.
fieldNames
=
res_meta
.
field_names
;
for
(
auto
&
item
:
res
){
resraw
.
fieldTypes
=
vector
<
enum_field_types
>
(
res_field
.
size
(),
resraw
.
choosen_onions
.
push_back
(
item
.
choosenOnions
[
0
]);
static_cast
<
enum_field_types
>
(
0
));
}
ResType
rawtorestype
=
MygetResTypeFromLuaTable
(
false
,
&
resraw
);
write_raw_data_to_files
(
resraw
,
db
,
table
);
auto
finalresults
=
decryptResults
(
rawtorestype
,
*
rm
);
parseResType
(
finalresults
);
}
else
if
(
string
(
argv
[
3
])
==
"8"
){
}
else
if
(
string
(
argv
[
3
])
==
"8"
){
std
::
string
db
=
"tdb"
,
table
=
"student"
;
std
::
string
db
=
"tdb"
,
table
=
"student"
;
std
::
unique_ptr
<
SchemaInfo
>
schema
=
myLoadSchemaInfo
();
std
::
unique_ptr
<
SchemaInfo
>
schema
=
myLoadSchemaInfo
();
...
@@ -1297,7 +1294,7 @@ main(int argc, char* argv[]) {
...
@@ -1297,7 +1294,7 @@ main(int argc, char* argv[]) {
}
}
resraw
.
show
();
resraw
.
show
();
write_raw_data_to_files
(
resraw
,
db
,
table
);
write_raw_data_to_files
(
resraw
,
db
,
table
);
cmp
(
resraw
);
cmp
(
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
);
...
...
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