BIND 10 trac1062, updated. cfd1d9e142fa2fd8b21f74de0e4a0109e0a04439 [1062] some minor editorial changes, mostly just folding long lines.
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Aug 11 09:08:25 UTC 2011
The branch, trac1062 has been updated
via cfd1d9e142fa2fd8b21f74de0e4a0109e0a04439 (commit)
from 5951ef6faaffcff62d9a9963260a932666e3decb (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 cfd1d9e142fa2fd8b21f74de0e4a0109e0a04439
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Thu Aug 11 02:07:39 2011 -0700
[1062] some minor editorial changes, mostly just folding long lines.
-----------------------------------------------------------------------
Summary of changes:
src/lib/datasrc/database.cc | 29 +++++++++++---------
src/lib/datasrc/sqlite3_connection.cc | 8 +++--
src/lib/datasrc/tests/database_unittest.cc | 2 +-
.../datasrc/tests/sqlite3_connection_unittest.cc | 3 +-
4 files changed, 23 insertions(+), 19 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/database.cc b/src/lib/datasrc/database.cc
index b13f3e9..abd979c 100644
--- a/src/lib/datasrc/database.cc
+++ b/src/lib/datasrc/database.cc
@@ -179,15 +179,16 @@ DatabaseClient::Finder::find(const isc::dns::Name& name,
try {
const isc::dns::RRType cur_type(columns[DatabaseConnection::TYPE_COLUMN]);
const isc::dns::RRTTL cur_ttl(columns[DatabaseConnection::TTL_COLUMN]);
- // Ths sigtype column was an optimization for finding the relevant
- // RRSIG RRs for a lookup. Currently this column is not used in this
- // revised datasource implementation. We should either start using it
- // again, or remove it from use completely (i.e. also remove it from
- // the schema and the backend implementation).
- // Note that because we don't use it now, we also won't notice it if
- // the value is wrong (i.e. if the sigtype column contains an rrtype
- // that is different from the actual value of the 'type covered' field
- // in the RRSIG Rdata).
+ // Ths sigtype column was an optimization for finding the
+ // relevant RRSIG RRs for a lookup. Currently this column is
+ // not used in this revised datasource implementation. We
+ // should either start using it again, or remove it from use
+ // completely (i.e. also remove it from the schema and the
+ // backend implementation).
+ // Note that because we don't use it now, we also won't notice
+ // it if the value is wrong (i.e. if the sigtype column
+ // contains an rrtype that is different from the actual value
+ // of the 'type covered' field in the RRSIG Rdata).
//cur_sigtype(columns[SIGTYPE_COLUMN]);
if (cur_type == type) {
@@ -199,7 +200,8 @@ DatabaseClient::Finder::find(const isc::dns::Name& name,
addOrCreate(result_rrset, name, getClass(), cur_type,
cur_ttl, columns[DatabaseConnection::RDATA_COLUMN]);
} else if (cur_type == isc::dns::RRType::CNAME()) {
- // There should be no other data, so result_rrset should be empty.
+ // There should be no other data, so result_rrset should
+ // be empty.
if (result_rrset) {
isc_throw(DataSourceError, "CNAME found but it is not "
"the only record for " + name.toText());
@@ -211,9 +213,10 @@ DatabaseClient::Finder::find(const isc::dns::Name& name,
// If we get signatures before we get the actual data, we
// can't know which ones to keep and which to drop...
// So we keep a separate store of any signature that may be
- // relevant and add them to the final RRset when we are done.
- // A possible optimization here is to not store them for types
- // we are certain we don't need
+ // relevant and add them to the final RRset when we are
+ // done.
+ // A possible optimization here is to not store them for
+ // types we are certain we don't need
sig_store.addSig(isc::dns::rdata::createRdata(cur_type,
getClass(),
columns[DatabaseConnection::RDATA_COLUMN]));
diff --git a/src/lib/datasrc/sqlite3_connection.cc b/src/lib/datasrc/sqlite3_connection.cc
index 750a62c..acba0e6 100644
--- a/src/lib/datasrc/sqlite3_connection.cc
+++ b/src/lib/datasrc/sqlite3_connection.cc
@@ -329,6 +329,7 @@ SQLite3Connection::searchForRecords(int zone_id, const std::string& name) {
"Error in sqlite3_bind_int() for zone_id " <<
zone_id << ", sqlite3 result code: " << result);
}
+
// use transient since name is a ref and may disappear
result = sqlite3_bind_text(dbparameters_->q_any_, 2, name.c_str(), -1,
SQLITE_TRANSIENT);
@@ -337,7 +338,7 @@ SQLite3Connection::searchForRecords(int zone_id, const std::string& name) {
"Error in sqlite3_bind_text() for name " <<
name << ", sqlite3 result code: " << result);
}
-};
+}
namespace {
// This helper function converts from the unsigned char* type (used by
@@ -382,8 +383,9 @@ SQLite3Connection::getNextRecord(std::string columns[], size_t column_count) {
resetSearch();
isc_throw(DataSourceError,
"Unexpected failure in sqlite3_step (sqlite result code " << rc << ")");
- } catch (std::bad_alloc) {
- isc_throw(DataSourceError, "bad_alloc in Sqlite3Connection::getNextRecord");
+ } catch (const std::bad_alloc&) {
+ isc_throw(DataSourceError,
+ "bad_alloc in Sqlite3Connection::getNextRecord");
}
// Compilers might not realize isc_throw always throws
return (false);
diff --git a/src/lib/datasrc/tests/database_unittest.cc b/src/lib/datasrc/tests/database_unittest.cc
index 69678f0..8cfbb08 100644
--- a/src/lib/datasrc/tests/database_unittest.cc
+++ b/src/lib/datasrc/tests/database_unittest.cc
@@ -51,7 +51,7 @@ public:
search_running_ = true;
// 'hardcoded' name to trigger exceptions (for testing
- // the error handling of find() (the other on is below in
+ // the error handling of find() (the other on is below in
// if the name is "exceptiononsearch" it'll raise an exception here
if (name == "dsexception.in.search.") {
isc_throw(DataSourceError, "datasource exception on search");
diff --git a/src/lib/datasrc/tests/sqlite3_connection_unittest.cc b/src/lib/datasrc/tests/sqlite3_connection_unittest.cc
index 7f70322..8fdbf9f 100644
--- a/src/lib/datasrc/tests/sqlite3_connection_unittest.cc
+++ b/src/lib/datasrc/tests/sqlite3_connection_unittest.cc
@@ -127,8 +127,7 @@ TEST_F(SQLite3Conn, getRecords) {
std::string columns[column_count];
// without search, getNext() should return false
- EXPECT_FALSE(conn->getNextRecord(columns,
- column_count));
+ EXPECT_FALSE(conn->getNextRecord(columns, column_count));
checkRecordRow(columns, "", "", "", "");
conn->searchForRecords(zone_id, "foo.bar.");
More information about the bind10-changes
mailing list