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
1ad297ab
Commit
1ad297ab
authored
May 29, 2018
by
yiwenshao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
finish type_storel
parent
0e2eb946
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
type_store.cc
tools/type_store.cc
+13
-9
No files found.
tools/type_store.cc
View file @
1ad297ab
...
...
@@ -67,22 +67,25 @@ getSelectField(SchemaInfo &schema, FieldMetaTrans &tf,std::string db,std::string
static
void
write_field_data_to_files
(
MySQLColumnData
&
resraw
,
FieldMetaTrans
&
res
,
string
db
,
string
table
,
string
field
)
{
std
::
string
numprefix
=
std
::
string
(
"data/"
)
+
db
+
"/"
+
table
+
std
::
string
(
"/"
)
+
"NUMF/"
+
field
+
"/"
;
std
::
string
strprefix
=
std
::
string
(
"data/"
)
+
db
+
"/"
+
table
+
std
::
string
(
"/"
)
+
"STRF/"
+
field
+
"/"
;
g_make_path
(
numprefix
);
g_make_path
(
strprefix
);
write_field_data_to_files
(
MySQLColumnData
&
resraw
,
FieldMetaTrans
&
res
,
string
db
,
string
table
,
string
field
,
enum
enum_field_types
oft
)
{
std
::
string
prefix
;
if
(
IS_NUM
(
oft
)){
prefix
=
std
::
string
(
"data/"
)
+
db
+
"/"
+
table
+
std
::
string
(
"/"
)
+
"NUMF/"
+
field
+
"/"
;
}
else
{
prefix
=
std
::
string
(
"data/"
)
+
db
+
"/"
+
table
+
std
::
string
(
"/"
)
+
"STRF/"
+
field
+
"/"
;
}
g_make_path
(
prefix
);
std
::
vector
<
std
::
string
>
filenames
;
for
(
auto
item
:
resraw
.
fieldNames
){
filenames
.
push_back
(
item
);
auto
temp
=
prefix
+
item
;
filenames
.
push_back
(
temp
);
}
int
len
=
resraw
.
fieldNames
.
size
();
for
(
int
i
=
0
;
i
<
len
;
i
++
){
if
(
IS_NUM
(
resraw
.
fieldTypes
[
i
])){
filenames
[
i
]
=
numprefix
+
filenames
[
i
];
writeColumndataNum
(
resraw
.
columnData
[
i
],
filenames
[
i
]);
}
else
{
filenames
[
i
]
=
strprefix
+
filenames
[
i
];
writeColumndataEscapeString
(
resraw
.
columnData
[
i
],
filenames
[
i
],
resraw
.
maxLengths
[
i
]);
}
}
...
...
@@ -118,7 +121,8 @@ static void store(std::string db, std::string table){
tf
.
setChoosenFieldLengths
(
lengths
);
tf
.
setSaltType
(
stype
);
tf
.
setSaltLength
(
slength
);
write_field_data_to_files
(
resraw
,
tf
,
db
,
table
,
tf
.
getOriginalFieldMeta
()
->
getFieldName
());
write_field_data_to_files
(
resraw
,
tf
,
db
,
table
,
tf
.
getOriginalFieldMeta
()
->
getFieldName
(),
tf
.
getOriginalFieldMeta
()
->
getSqlType
());
}
write_meta_new
(
res
,
db
,
table
);
//generate the backup query and then fetch the tuples
...
...
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