BIND 10 master, updated. b67bc1ca8694f7f0fab51b645ad1227c05866e11 Merge #2180

BIND 10 source code commits bind10-changes at lists.isc.org
Thu Aug 30 12:35:53 UTC 2012


The branch, master has been updated
       via  b67bc1ca8694f7f0fab51b645ad1227c05866e11 (commit)
       via  4275cf4bdb01aecee2ef8beb52d40c320e2016b0 (commit)
       via  fcde1f32cd4925a3c5b4c061a8b79fb83e2406af (commit)
      from  0f43c975990d11c7f0a071f3bd29836d28e08f4a (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 b67bc1ca8694f7f0fab51b645ad1227c05866e11
Merge: 0f43c97 4275cf4
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Thu Aug 30 14:34:32 2012 +0200

    Merge #2180
    
    Warn administrator when creating an empty SQLite data source.

-----------------------------------------------------------------------

Summary of changes:
 src/lib/datasrc/datasrc_messages.mes |   14 ++++++++++++--
 src/lib/datasrc/sqlite3_accessor.cc  |   10 +++++-----
 src/lib/datasrc/sqlite3_datasrc.cc   |    2 +-
 3 files changed, 18 insertions(+), 8 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/datasrc_messages.mes b/src/lib/datasrc/datasrc_messages.mes
index 6837476..94b4d42 100644
--- a/src/lib/datasrc/datasrc_messages.mes
+++ b/src/lib/datasrc/datasrc_messages.mes
@@ -787,10 +787,20 @@ example.com). However, this name is not contained in any zone in the
 data source. This is an error since it indicates a problem in the earlier
 processing of the query.
 
-% DATASRC_SQLITE_SETUP setting up SQLite database
+% DATASRC_SQLITE_SETUP setting up new SQLite3 database in '%1'
 The database for SQLite data source was found empty. It is assumed this is the
 first run and it is being initialized with current schema.  It'll still contain
-no data, but it will be ready for use.
+no data, but it will be ready for use. If this is indeed the first run of
+BIND 10, it is to be expected and completely harmless. If you just configured
+a data source to point to an existing file and you see this, you may have
+misspelled the file name.
+
+% DATASRC_SQLITE_SETUP_OLD_API setting up new SQLite database
+The database for SQLite data source was found empty. It is assumed this is the
+first run and it is being initialized with current schema.  It'll still contain
+no data, but it will be ready for use. This is similar to DATASRC_SQLITE_SETUP
+message, but it is logged from the old API. You should never see it, since the
+API is deprecated.
 
 % DATASRC_STATIC_CLASS_NOT_CH static data source can handle CH class only
 An error message indicating that a query requesting a RR for a class other
diff --git a/src/lib/datasrc/sqlite3_accessor.cc b/src/lib/datasrc/sqlite3_accessor.cc
index ba21de8..457d578 100644
--- a/src/lib/datasrc/sqlite3_accessor.cc
+++ b/src/lib/datasrc/sqlite3_accessor.cc
@@ -474,8 +474,8 @@ private:
 
 // return db version
 pair<int, int>
-createDatabase(sqlite3* db) {
-    logger.info(DATASRC_SQLITE_SETUP);
+createDatabase(sqlite3* db, const std::string& name) {
+    logger.warn(DATASRC_SQLITE_SETUP).arg(name);
 
     // try to get an exclusive lock. Once that is obtained, do the version
     // check *again*, just in case this process was racing another
@@ -501,12 +501,12 @@ createDatabase(sqlite3* db) {
 }
 
 void
-checkAndSetupSchema(Initializer* initializer) {
+checkAndSetupSchema(Initializer* initializer, const std::string& name) {
     sqlite3* const db = initializer->params_.db_;
 
     pair<int, int> schema_version = checkSchemaVersion(db);
     if (schema_version.first == -1) {
-        schema_version = createDatabase(db);
+        schema_version = createDatabase(db, name);
     } else if (schema_version.first != SQLITE_SCHEMA_MAJOR_VERSION) {
         LOG_ERROR(logger, DATASRC_SQLITE_INCOMPATIBLE_VERSION)
             .arg(schema_version.first).arg(schema_version.second)
@@ -540,7 +540,7 @@ SQLite3Accessor::open(const std::string& name) {
         isc_throw(SQLite3Error, "Cannot open SQLite database file: " << name);
     }
 
-    checkAndSetupSchema(&initializer);
+    checkAndSetupSchema(&initializer, name);
     initializer.move(dbparameters_.get());
 }
 
diff --git a/src/lib/datasrc/sqlite3_datasrc.cc b/src/lib/datasrc/sqlite3_datasrc.cc
index b450cd5..bced1ae 100644
--- a/src/lib/datasrc/sqlite3_datasrc.cc
+++ b/src/lib/datasrc/sqlite3_datasrc.cc
@@ -788,7 +788,7 @@ private:
 
 // return db version
 pair<int, int> create_database(sqlite3* db) {
-    logger.info(DATASRC_SQLITE_SETUP);
+    logger.info(DATASRC_SQLITE_SETUP_OLD_API);
 
     // try to get an exclusive lock. Once that is obtained, do the version
     // check *again*, just in case this process was racing another



More information about the bind10-changes mailing list