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
3695a861
Commit
3695a861
authored
Mar 31, 2018
by
yiwenshao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add comments
parent
4ac47930
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
3 additions
and
51 deletions
+3
-51
all
crypto/all
+0
-16
ddl_handler.cc
main/ddl_handler.cc
+2
-7
ddl_handler.hh
main/ddl_handler.hh
+0
-10
dml_handler.hh
main/dml_handler.hh
+0
-6
sql_handler.cc
main/sql_handler.cc
+1
-3
sql_handler.hh
main/sql_handler.hh
+0
-9
No files found.
crypto/all
deleted
100644 → 0
View file @
4ac47930
BasicCrypto.cc
paillier.cc
urandom.cc
arc4.cc
hgd.cc
pbkdf2.cc
ecjoin.cc
ECJoin.cc
search.cc
skip32.cc
ffx.cc
online_ope.cc
mont.cc
prng.cc
ope.cc
SWPSearch.cc
main/ddl_handler.cc
View file @
3695a861
...
...
@@ -373,8 +373,7 @@ SQLDispatcher *buildDDLDispatcher()
std
::
pair
<
AbstractQueryExecutor
::
ResultType
,
AbstractAnything
*>
DDLQueryExecutor
::
nextImpl
(
const
ResType
&
res
,
const
NextParams
&
nparams
)
{
nextImpl
(
const
ResType
&
res
,
const
NextParams
&
nparams
)
{
reenter
(
this
->
corot
)
{
yield
{
{
...
...
@@ -393,7 +392,6 @@ nextImpl(const ResType &res, const NextParams &nparams)
TEST_ErrPkt
(
res
.
success
(),
"DDL query failed"
);
// save the results so we can return them to the client
this
->
ddl_res
=
res
;
yield
{
return
CR_QUERY_AGAIN
(
" INSERT INTO "
+
MetaData
::
Table
::
remoteQueryCompletion
()
+
...
...
@@ -402,20 +400,17 @@ nextImpl(const ResType &res, const NextParams &nparams)
" '"
+
TypeText
<
CompletionType
>::
toText
(
CompletionType
::
Onion
)
+
"'"
" );"
);
}
TEST_ErrPkt
(
res
.
success
(),
"failed issuing ddl completion"
);
// execute the original query against the embedded database
// > this is a ddl query so do not put it into a transaction
TEST_ErrPkt
(
nparams
.
ps
.
getEConn
()
->
execute
(
nparams
.
original_query
),
"Failed to execute DDL query against embedded database!"
);
TEST_ErrPkt
(
deltaOutputAfterQuery
(
nparams
.
ps
.
getEConn
(),
this
->
deltas
,
this
->
embedded_completion_id
.
get
()),
"deltaOuputAfterQuery failed for DDL"
);
yield
return
CR_RESULTS
(
this
->
ddl_res
.
get
());
}
assert
(
false
);
}
main/ddl_handler.hh
View file @
3695a861
...
...
@@ -9,12 +9,8 @@
#include <sql_lex.h>
class
DDLQueryExecutor
:
public
AbstractQueryExecutor
{
AssignOnce
<
ResType
>
ddl_res
;
AssignOnce
<
uint64_t
>
embedded_completion_id
;
public
:
const
std
::
string
new_query
;
DDLQueryExecutor
(
const
LEX
&
new_lex
,
...
...
@@ -23,7 +19,6 @@ public:
~
DDLQueryExecutor
()
{}
std
::
pair
<
ResultType
,
AbstractAnything
*>
nextImpl
(
const
ResType
&
res
,
const
NextParams
&
nparams
);
private
:
const
std
::
vector
<
std
::
unique_ptr
<
Delta
>
>
deltas
;
bool
stales
()
const
{
return
true
;}
...
...
@@ -35,7 +30,6 @@ class DDLHandler : public SQLHandler {
public
:
virtual
AbstractQueryExecutor
*
transformLex
(
Analysis
&
analysis
,
LEX
*
lex
)
const
;
private
:
virtual
AbstractQueryExecutor
*
rewriteAndUpdate
(
Analysis
&
a
,
LEX
*
lex
,
const
Preamble
&
pre
)
const
=
0
;
...
...
@@ -44,7 +38,6 @@ protected:
virtual
~
DDLHandler
()
{;}
};
class
CreateTableHandler
:
public
DDLHandler
{
//must rewrite the header here or we get pure virtual function
virtual
AbstractQueryExecutor
*
...
...
@@ -52,7 +45,4 @@ class CreateTableHandler : public DDLHandler {
};
SQLDispatcher
*
buildDDLDispatcher
();
main/dml_handler.hh
View file @
3695a861
...
...
@@ -27,14 +27,12 @@ class SpecialUpdateExecutor : public AbstractQueryExecutor {
const
std
::
string
plain_table
;
const
std
::
string
crypted_table
;
const
std
::
string
where_clause
;
// coroutine state
AssignOnce
<
ResType
>
dec_res
;
AssignOnce
<
DBResult
*>
original_query_dbres
;
AssignOnce
<
std
::
string
>
escaped_output_values
;
AssignOnce
<
ReturnMeta
>
select_rmeta
;
AssignOnce
<
bool
>
in_trx
;
public
:
SpecialUpdateExecutor
(
const
std
::
string
&
plain_table
,
const
std
::
string
&
crypted_table
,
...
...
@@ -154,7 +152,3 @@ rewrite_field_value_pairs(List_iterator<Item> fd_it,
List_iterator
<
Item
>
val_it
,
Analysis
&
a
,
List
<
Item
>
*
const
res_fields
,
List
<
Item
>
*
const
res_values
);
main/sql_handler.cc
View file @
3695a861
...
...
@@ -19,9 +19,7 @@ genericPreamble(const NextParams &nparams)
// We handle before any queries because a failed query
// may stale the database during recovery and then
// we'd have to handle there as well.
//首先根据stales来设置这个executor会不会让当前在shared中的cache变成stale,对于simple来说, 继承的是默认的情况, 所以
//不会设置cache为stale, 也就是下次进入rewrite的时候, 不需要重新load.
//stales, if set true, will set the cache status to stale, which triggers the reloading of metadata. The default value of stale, which is from AbstractQueryExecutor, is false.
try
{
nparams
.
ps
.
getSchemaCache
().
updateStaleness
(
nparams
.
ps
.
getEConn
(),
this
->
stales
());
...
...
main/sql_handler.hh
View file @
3695a861
#pragma once
#include <main/Analysis.hh>
#include <util/yield.hpp>
#include <sql_lex.h>
#include <map>
#define CR_QUERY_AGAIN(query) \
...
...
@@ -25,7 +22,6 @@ class Anything;
class
AbstractAnything
{
public
:
virtual
~
AbstractAnything
()
=
0
;
template
<
typename
Type
>
Type
extract
()
const
...
...
@@ -62,22 +58,18 @@ struct NextParams {
class
AbstractQueryExecutor
{
protected
:
coroutine
corot
;
public
:
enum
class
ResultType
{
RESULTS
,
QUERY_COME_AGAIN
,
QUERY_USE_RESULTS
};
AbstractQueryExecutor
()
{}
virtual
~
AbstractQueryExecutor
();
std
::
pair
<
ResultType
,
AbstractAnything
*>
next
(
const
ResType
&
res
,
const
NextParams
&
nparams
);
virtual
std
::
pair
<
ResultType
,
AbstractAnything
*>
nextImpl
(
const
ResType
&
res
,
const
NextParams
&
nparams
)
=
0
;
//true will set the staleness of the current cache id to true, which results in a reloading of schemaInfo
virtual
bool
stales
()
const
{
return
false
;}
//if usesEmbedded is true, then the current db of the embedded MySQL is set to embedded_db
virtual
bool
usesEmbedded
()
const
{
return
false
;}
private
:
void
genericPreamble
(
const
NextParams
&
nparams
);
};
...
...
@@ -95,7 +87,6 @@ class NoOpExecutor : public AbstractQueryExecutor {
public
:
NoOpExecutor
()
{}
~
NoOpExecutor
()
{}
std
::
pair
<
ResultType
,
AbstractAnything
*>
nextImpl
(
const
ResType
&
res
,
const
NextParams
&
nparams
);
};
...
...
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