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
2c9258db
Commit
2c9258db
authored
May 27, 2017
by
Casualet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
e1a77857
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
createSelect.cc
packages/tls/mysqlWrapper/createSelect.cc
+4
-5
main.cc
packages/tls/mysqlWrapper/main.cc
+5
-2
No files found.
packages/tls/mysqlWrapper/createSelect.cc
View file @
2c9258db
...
...
@@ -5,9 +5,7 @@
#include <string>
using
namespace
std
;
extern
Connect
*
con
;
void
createSelect
(){
string
database
,
table
;
cin
>>
database
>>
table
;
void
createSelect
(
string
database
,
string
table
){
auto
dbresult
=
con
->
execute
(
string
(
"SELECT * FROM `"
)
+
database
+
"`.`"
+
string
(
table
)
+
"` LIMIT 1;"
);
DBResult
*
result
=
dbresult
.
get
();
vector
<
vector
<
string
>>
rows
=
result
->
getRows
();
...
...
@@ -27,8 +25,9 @@ void createSelect(){
cout
<<
head
<<
endl
;
}
int
main
(){
createSelect
();
int
main
(
int
argc
,
char
**
argv
){
if
(
argc
==
3
)
return
0
;
createSelect
(
string
(
argv
[
1
]),
string
(
argv
[
2
]));
return
0
;
}
packages/tls/mysqlWrapper/main.cc
View file @
2c9258db
...
...
@@ -9,7 +9,7 @@ extern Connect *con;
//http://php.net/manual/zh/function.mysql-escape-string.php
//https://dev.mysql.com/doc/refman/5.7/en/string-functions.html#function_quote
//backup in configurable extended version
static
const
int
numOfPipe
=
3
;
static
int
numOfPipe
=
3
;
void
backupselect
(){
string
query
,
table
;
getline
(
cin
,
query
);
...
...
@@ -48,7 +48,10 @@ void backupselect(){
}
}
int
main
(){
int
main
(
int
argc
,
char
**
argv
){
if
(
argc
!=
2
)
return
0
;
string
num
=
string
(
argv
[
1
]);
numOfPipe
=
stoi
(
num
);
backupselect
();
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