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
e3440d8c
Commit
e3440d8c
authored
May 20, 2018
by
yiwenshao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug in simple load
parent
ba549a50
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
43 deletions
+14
-43
CURRENT.conf
conf/CURRENT.conf
+2
-2
global.constant
conf/global.constant
+1
-1
simple_load_new.cc
tools/simple_load_new.cc
+3
-8
simple_store_new.cc
tools/simple_store_new.cc
+0
-30
constants.cc
util/constants.cc
+5
-0
reuse.cc
wrapper/reuse.cc
+3
-2
No files found.
conf/CURRENT.conf
View file @
e3440d8c
...
...
@@ -5,8 +5,8 @@
[
onions
for
num
]
oDET
:
DET
oOPE
:
OPE
#
oAGG: HOM
oASHE
:
ASHE
oAGG
:
HOM
#
oASHE: ASHE
[
end
]
...
...
conf/global.constant
View file @
e3440d8c
...
...
@@ -8,7 +8,7 @@ useDET:true
useSalt:true
#NA,MIN,MIDEAN,FULL
BS_STR:MIN
BS_IA:
MIN
BS_IA:
NA
BS_IH:MIN
#true or false
USE_ASHE:true
...
...
tools/simple_load_new.cc
View file @
e3440d8c
...
...
@@ -91,17 +91,16 @@ load_columns(std::vector<FieldMetaTrans> &fmts,std::string db,std::string table)
constGlobalConstants
.
loadCount
);
}
gfb
.
annoOnionNameToFileVector
[
item
.
getChoosenOnionName
()[
i
]]
=
std
::
move
(
column
);
gfb
.
annoOnionNameToType
[
item
.
getChoosenOnionName
()[
i
]]
=
item
.
getChoosenFieldTypes
()[
i
];
}
if
(
item
.
getHasSalt
())
{
std
::
vector
<
std
::
string
>
column
;
std
::
string
filename
=
prefix
+
item
.
getSaltName
();
loadFileNoEscapeLimitCount
(
filename
,
column
,
constGlobalConstants
.
loadCount
);
gfb
.
annoOnionNameToFileVector
[
item
.
getSaltName
()]
=
std
::
move
(
column
);
gfb
.
annoOnionNameToType
[
item
.
getSaltName
()]
=
item
.
getSaltType
();
}
}
for
(
unsigned
int
i
=
0
;
i
<
gfb
.
field_names
.
size
();
i
++
){
gfb
.
annoOnionNameToType
[
gfb
.
field_names
[
i
]]
=
gfb
.
field_types
[
i
];
}
}
/*should choose the right decryption onion*/
...
...
@@ -163,8 +162,6 @@ static ResType load_files_new(std::string db, std::string table){
}
mf
.
show
();
load_columns
(
fmts
,
db
,
table
);
vector
<
string
>
field_names
;
vector
<
int
>
field_types
;
vector
<
int
>
field_lengths
;
...
...
@@ -172,7 +169,6 @@ static ResType load_files_new(std::string db, std::string table){
UNUSED
(
rm
);
create_embedded_thd
(
0
);
rawMySQLReturnValue
resraw
;
vector
<
vector
<
string
>>
res_field
;
for
(
auto
item
:
field_names
){
res_field
.
push_back
(
gfb
.
annoOnionNameToFileVector
[
item
]);
...
...
@@ -262,7 +258,6 @@ void local_wrapper(const Item &i, const FieldMeta &fm, Analysis &a,
l
.
push_back
(
new
Item_int
(
static_cast
<
ulonglong
>
(
salt
)));
}
}
for
(
auto
it
:
l
)
{
append_list
->
push_back
(
it
);
}
...
...
tools/simple_store_new.cc
View file @
e3440d8c
...
...
@@ -59,34 +59,6 @@ std::string getSelectQuery(SchemaInfo &schema, std::vector<FieldMetaTrans> &tfds
return
res
;
}
static
void
write_meta
(
std
::
vector
<
FieldMetaTrans
>
&
res
,
string
db
,
string
table
){
TableMetaTrans
mf
(
db
,
table
,
res
);
mf
.
set_db_table
(
db
,
table
);
mf
.
serialize
();
}
static
void
write_raw_data_to_files
(
MySQLColumnData
&
resraw
,
std
::
vector
<
FieldMetaTrans
>
&
res
,
string
db
,
string
table
){
//write metafiles
write_meta
(
res
,
db
,
table
);
//write datafiles
std
::
string
prefix
=
std
::
string
(
"data/"
)
+
db
+
"/"
+
table
+
"/"
;
std
::
vector
<
std
::
string
>
filenames
;
for
(
auto
item
:
resraw
.
fieldNames
){
item
=
prefix
+
item
;
filenames
.
push_back
(
item
);
}
int
len
=
resraw
.
fieldNames
.
size
();
for
(
int
i
=
0
;
i
<
len
;
i
++
){
if
(
IS_NUM
(
resraw
.
fieldTypes
[
i
])){
writeColumndataNum
(
resraw
.
columnData
[
i
],
filenames
[
i
]);
}
else
{
writeColumndataEscapeString
(
resraw
.
columnData
[
i
],
filenames
[
i
],
resraw
.
maxLengths
[
i
]);
}
}
}
static
void
write_meta_new
(
std
::
vector
<
FieldMetaTrans
>
&
res
,
string
db
,
string
table
){
std
::
string
filename
=
std
::
string
(
"data/"
)
+
db
+
"/"
+
table
+
"/metadata.data"
;
...
...
@@ -178,8 +150,6 @@ static void store(std::string db, std::string table){
/*
write_raw_data_to_files(resraw,res,db,table);
*/
(
void
)
executeAndGetColumnData
;
(
void
)
write_raw_data_to_files
;
}
...
...
util/constants.cc
View file @
e3440d8c
...
...
@@ -126,6 +126,11 @@ globalConstants initGlobalConstants(){
/* the following values need not be determined
at runtime.*/
res
.
logFile
=
"LOG.TXT"
;
if
(
res
.
BS_IA
!=
0
&&
res
.
BS_IH
!=
0
){
POINT
assert
(
0
);
}
infile
.
close
();
return
res
;
}
...
...
wrapper/reuse.cc
View file @
e3440d8c
...
...
@@ -168,8 +168,9 @@ ResType rawMySQLReturnValue_to_ResType(bool isNULL,rawMySQLReturnValue *inRow,in
for
(
auto
inRows
:
inRow
->
rowValues
)
{
std
::
vector
<
Item
*>
curTempRow
=
itemNullVector
(
types
.
size
());
for
(
int
i
=
0
;
i
<
(
int
)(
inRows
.
size
());
i
++
){
if
(
inRows
[
i
]
!=
"NULL"
)
curTempRow
[
i
]
=
(
MySQLFieldTypeToItem
(
types
[
i
],
inRows
[
i
]));
//why unsinged processing is not needed here?
if
(
inRows
[
i
]
!=
"NULL"
&&
inRows
[
i
]
!=
"
\"
NULL
\"
"
)
curTempRow
[
i
]
=
(
MySQLFieldTypeToItem
(
types
[
i
],
inRows
[
i
]));
//why unsinged processing is not needed here?
}
rows
.
push_back
(
curTempRow
);
}
...
...
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