Commit fb7201b9 authored by JINMEI Tatuya's avatar JINMEI Tatuya

[1891] be sure to reject addNSEC3 attempt before begin transaction.

parent bea9aaf1
......@@ -1159,7 +1159,10 @@ void
SQLite3Accessor::addNSEC3RecordToZone(
const string (&columns)[ADD_NSEC3_COLUMN_COUNT])
{
// TODO: no transaction case
if (!dbparameters_->updating_zone) {
isc_throw(DataSourceError, "adding NSEC3-related record to SQLite3 "
"data source without transaction");
}
// XXX: the current implementation of SQLite3 schema requires the 'owner'
// column, and the current implementation of getAllRecords() relies on it,
......
......@@ -1079,6 +1079,12 @@ TEST_F(SQLite3Update, duplicateAdd) {
TEST_F(SQLite3Update, invalidAdd) {
// An attempt of add before an explicit start of transaction
EXPECT_THROW(accessor->addRecordToZone(add_columns), DataSourceError);
// Same for addNSEC3.
copy(nsec3_data, nsec3_data + DatabaseAccessor::ADD_NSEC3_COLUMN_COUNT,
add_nsec3_columns);
EXPECT_THROW(accessor->addNSEC3RecordToZone(add_nsec3_columns),
DataSourceError);
}
TEST_F(SQLite3Update, deleteRecord) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment