Skip to content
GitLab
Projects
Groups
Snippets
/
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
b67bc1ca
Unverified
Commit
b67bc1ca
authored
Aug 30, 2012
by
Michal 'vorner' Vaner
Browse files
Merge
#2180
Warn administrator when creating an empty SQLite data source.
parents
0f43c975
4275cf4b
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/lib/datasrc/datasrc_messages.mes
View file @
b67bc1ca
...
...
@@ -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
SQLite
3
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
...
...
src/lib/datasrc/sqlite3_accessor.cc
View file @
b67bc1ca
...
...
@@ -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
());
}
...
...
src/lib/datasrc/sqlite3_datasrc.cc
View file @
b67bc1ca
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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