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
666d46b8
Commit
666d46b8
authored
May 16, 2017
by
casualet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
this version of cdb_test can do simple curd
parent
cf4e1298
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
16 deletions
+12
-16
INSTALL.sh
INSTALL.sh
+1
-1
cdb_test.cc
main/cdb_test.cc
+11
-15
No files found.
INSTALL.sh
View file @
666d46b8
sudo
apt update
-y
sudo
apt remove bison libbison-dev
-y
sudo
apt upgrade
-y
sudo
apt
install
g++-4.7 gawk liblua5.1-0-dev libntl-dev libmysqlclient-dev libssl-dev libbsd-dev libevent-dev libglib2.0-dev libgmp-dev mysql-server libaio-dev automake gtk-doc-tools flex cmake libncurses5-dev make ruby lua5.1 libmysqld-dev
-y
sudo
apt
install
g++-4.7 gawk liblua5.1-0-dev libntl-dev libmysqlclient-dev libssl-dev libbsd-dev libevent-dev libglib2.0-dev libgmp-dev mysql-server libaio-dev automake gtk-doc-tools flex cmake libncurses5-dev make ruby lua5.1 libmysqld-dev
exuberant-ctags cscope
-y
cd
packages
;
sudo
dpkg
-i
libbison-dev_2.7.1.dfsg-1_amd64.deb
;
sudo
dpkg
-i
bison_2.7.1.dfsg-1_amd64.deb
;
cd
..
...
...
main/cdb_test.cc
View file @
666d46b8
...
...
@@ -41,7 +41,7 @@
#include <util/yield.hpp>
#include <sstream>
#include <unistd.h>
FILE
*
fr
,
*
fw
;
...
...
@@ -861,7 +861,6 @@ int
main
()
{
fr
=
fopen
((
const
char
*
)
"readFile"
,(
const
char
*
)
"r"
);
fw
=
fopen
((
const
char
*
)
"writeFile"
,(
const
char
*
)
"a"
);
if
(
!
fr
||!
fw
)
return
0
;
std
::
string
client
=
"192.168.1.1:1234"
;
//one Wrapper per user.
...
...
@@ -871,44 +870,41 @@ main() {
//const std::string master_key = "113341234";
const
std
::
string
master_key
=
"113341234HEHE"
;
SharedProxyState
*
shared_ps
=
new
SharedProxyState
(
ci
,
embeddedDir
,
master_key
,
determineSecurityRating
());
char
*
buffer
;
if
((
buffer
=
getcwd
(
NULL
,
0
))
==
NULL
){
perror
(
"getcwd error"
);
}
embeddedDir
=
std
::
string
(
buffer
)
+
"/shadow"
;
SharedProxyState
*
shared_ps
=
new
SharedProxyState
(
ci
,
embeddedDir
,
master_key
,
determineSecurityRating
());
assert
(
0
==
mysql_thread_init
());
//we init embedded database here.
clients
[
client
]
->
ps
=
std
::
unique_ptr
<
ProxyState
>
(
new
ProxyState
(
*
shared_ps
));
clients
[
client
]
->
ps
->
safeCreateEmbeddedTHD
();
//Connect end!!
globalConn
=
new
Connect
(
ci
.
server
,
ci
.
user
,
ci
.
passwd
,
ci
.
port
);
std
::
string
curQuery
=
"SHOW DATABASES;"
;
std
::
cout
<<
"please input a new query:######################################################"
<<
std
::
endl
;
std
::
getline
(
std
::
cin
,
curQuery
);
unsigned
long
long
_thread_id
=
globalConn
->
get_thread_id
();
unsigned
long
long
_thread_id
=
globalConn
->
get_thread_id
();
while
(
curQuery
!=
"quit"
){
if
(
curQuery
.
size
()
==
0
){
std
::
cout
<<
std
::
endl
;
std
::
getline
(
std
::
cin
,
curQuery
);
continue
;
}
if
(
curQuery
==
"back"
){
startBack
();
}
else
{
std
::
cout
<<
GREEN_BEGIN
<<
"curQuery: "
<<
curQuery
<<
"
\n
"
<<
COLOR_END
<<
std
::
endl
;
batchTogether
(
client
,
curQuery
,
_thread_id
);
}
std
::
unique_ptr
<
SchemaInfo
>
schema
=
myLoadSchemaInfo
();
processSchemaInfo
(
*
schema
);
std
::
cout
<<
GREEN_BEGIN
<<
"
\n
please input a new query:#######"
<<
COLOR_END
<<
std
::
endl
;
std
::
getline
(
std
::
cin
,
curQuery
);
}
fclose
(
fr
);
fclose
(
fw
);
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