BIND 10 trac1330, updated. d2e805bb39d06f0ed47c49879909f35b5d341530 [1330] Corrected a problem introduction in an earlier commit
BIND 10 source code commits
bind10-changes at lists.isc.org
Tue Nov 8 19:11:27 UTC 2011
The branch, trac1330 has been updated
via d2e805bb39d06f0ed47c49879909f35b5d341530 (commit)
from 92794c72752a77005c2f9c7683fd2c65d7d802e9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit d2e805bb39d06f0ed47c49879909f35b5d341530
Author: Stephen Morris <stephen at isc.org>
Date: Tue Nov 8 19:10:20 2011 +0000
[1330] Corrected a problem introduction in an earlier commit
Inadvertantly removed a check for NULL.
-----------------------------------------------------------------------
Summary of changes:
src/lib/datasrc/sqlite3_accessor.cc | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/sqlite3_accessor.cc b/src/lib/datasrc/sqlite3_accessor.cc
index c0c0666..47a1084 100644
--- a/src/lib/datasrc/sqlite3_accessor.cc
+++ b/src/lib/datasrc/sqlite3_accessor.cc
@@ -141,8 +141,10 @@ struct SQLite3Parameters {
void
finalizeStatements() {
for (int i = 0; i < NUM_STATEMENTS; ++i) {
- sqlite3_finalize(statements_[i]);
- statements_[i] = NULL;
+ if (statements_[i] != NULL) {
+ sqlite3_finalize(statements_[i]);
+ statements_[i] = NULL;
+ }
}
}
@@ -628,8 +630,8 @@ public:
bindInt(DIFF_RECS, 1, zone_id);
bindInt(DIFF_RECS, 2, low_id);
bindInt(DIFF_RECS, 3, high_id);
- } catch (...) {
+ } catch (...) {
// Something wrong, clear up everything.
accessor_->dbparameters_->finalizeStatements();
throw;
@@ -656,8 +658,9 @@ public:
// Last call (if any) didn't reach end of result set, so we
// can read another row from it.
//
- // Get a pointer to the statement for brevity (does not transfer
- // resources)
+ // Get a pointer to the statement for brevity (this does not transfer
+ // ownership of the statement to this class, so there is no need to
+ // tidy up after we have finished using it).
sqlite3_stmt* stmt = accessor_->dbparameters_->getStatement(DIFF_RECS);
const int rc(sqlite3_step(stmt));
@@ -680,9 +683,10 @@ public:
private:
- /// \brief Clear Statement Bindings
+ /// \brief Reset prepared statement
///
- /// Resets the statement and clears any bindings attached to it.
+ /// Sets up the statement so that new parameters can be attached to it and
+ /// that it can be used to query for another difference sequence.
///
/// \param stindex Index of prepared statement to which to bind
void reset(int stindex) {
@@ -825,7 +829,6 @@ private:
// Attributes
boost::shared_ptr<const SQLite3Accessor> accessor_; // Accessor object
- sqlite3_stmt* stmt_; // Prepared statement for this iterator
int last_status_; // Last status received from sqlite3_step
};
More information about the bind10-changes
mailing list