Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
0953b3f5
Commit
0953b3f5
authored
Aug 25, 2011
by
JINMEI Tatuya
Browse files
[1068] renamed StatementExecuter to StatementProcessor as the latter
would sound less odd.
parent
df047c5c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/datasrc/sqlite3_accessor.cc
View file @
0953b3f5
...
...
@@ -89,18 +89,18 @@ struct SQLite3Parameters {
// statement, which is completed with a single "step" (normally within a
// single call to an SQLite3Database method). In particular, it cannot be
// used for "SELECT" variants, which generally expect multiple matching rows.
class
Statement
Execute
r
{
class
Statement
Processo
r
{
public:
// desc will be used on failure in the what() message of the resulting
// DataSourceError exception.
Statement
Execute
r
(
SQLite3Parameters
&
dbparameters
,
StatementID
stmt_id
,
const
char
*
desc
)
:
Statement
Processo
r
(
SQLite3Parameters
&
dbparameters
,
StatementID
stmt_id
,
const
char
*
desc
)
:
dbparameters_
(
dbparameters
),
stmt_id_
(
stmt_id
),
desc_
(
desc
)
{
sqlite3_clear_bindings
(
dbparameters_
.
statements_
[
stmt_id_
]);
}
~
Statement
Execute
r
()
{
~
Statement
Processo
r
()
{
sqlite3_reset
(
dbparameters_
.
statements_
[
stmt_id_
]);
}
...
...
@@ -454,13 +454,13 @@ SQLite3Accessor::startUpdateZone(const string& zone_name, const bool replace) {
return
(
zone_info
);
}
Statement
Execute
r
(
*
dbparameters_
,
BEGIN
,
"start an SQLite3 transaction"
).
exec
();
Statement
Processo
r
(
*
dbparameters_
,
BEGIN
,
"start an SQLite3 transaction"
).
exec
();
if
(
replace
)
{
try
{
Statement
Execute
r
delzone_exec
(
*
dbparameters_
,
DEL_ZONE_RECORDS
,
"delete zone records"
);
Statement
Processo
r
delzone_exec
(
*
dbparameters_
,
DEL_ZONE_RECORDS
,
"delete zone records"
);
sqlite3_clear_bindings
(
dbparameters_
->
statements_
[
DEL_ZONE_RECORDS
]);
...
...
@@ -476,8 +476,8 @@ SQLite3Accessor::startUpdateZone(const string& zone_name, const bool replace) {
// Once we start a transaction, if something unexpected happens
// we need to rollback the transaction so that a subsequent update
// is still possible with this accessor.
Statement
Execute
r
(
*
dbparameters_
,
ROLLBACK
,
"rollback an SQLite3 transaction"
).
exec
();
Statement
Processo
r
(
*
dbparameters_
,
ROLLBACK
,
"rollback an SQLite3 transaction"
).
exec
();
throw
;
}
}
...
...
@@ -495,8 +495,8 @@ SQLite3Accessor::commitUpdateZone() {
"data source without transaction"
);
}
Statement
Execute
r
(
*
dbparameters_
,
COMMIT
,
"commit an SQLite3 transaction"
).
exec
();
Statement
Processo
r
(
*
dbparameters_
,
COMMIT
,
"commit an SQLite3 transaction"
).
exec
();
dbparameters_
->
updating_zone
=
false
;
dbparameters_
->
updated_zone_id
=
-
1
;
}
...
...
@@ -508,8 +508,8 @@ SQLite3Accessor::rollbackUpdateZone() {
"data source without transaction"
);
}
Statement
Execute
r
(
*
dbparameters_
,
ROLLBACK
,
"rollback an SQLite3 transaction"
).
exec
();
Statement
Processo
r
(
*
dbparameters_
,
ROLLBACK
,
"rollback an SQLite3 transaction"
).
exec
();
dbparameters_
->
updating_zone
=
false
;
dbparameters_
->
updated_zone_id
=
-
1
;
}
...
...
@@ -522,7 +522,7 @@ doUpdate(SQLite3Parameters& dbparams, StatementID stmt_id,
COLUMNS_TYPE
update_params
,
const
char
*
exec_desc
)
{
sqlite3_stmt
*
const
stmt
=
dbparams
.
statements_
[
stmt_id
];
Statement
Execute
r
executer
(
dbparams
,
stmt_id
,
exec_desc
);
Statement
Processo
r
executer
(
dbparams
,
stmt_id
,
exec_desc
);
int
param_id
=
0
;
if
(
sqlite3_bind_int
(
stmt
,
++
param_id
,
dbparams
.
updated_zone_id
)
...
...
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