diff --git a/src/lib/datasrc/sqlite3_accessor.cc b/src/lib/datasrc/sqlite3_accessor.cc index d606672da2..ef1562a1d9 100644 --- a/src/lib/datasrc/sqlite3_accessor.cc +++ b/src/lib/datasrc/sqlite3_accessor.cc @@ -1197,8 +1197,10 @@ void SQLite3Accessor::deleteNSEC3RecordInZone( const string (¶ms)[DEL_PARAM_COUNT]) { - // TBD: no transaction check - + if (!dbparameters_->updating_zone) { + isc_throw(DataSourceError, "deleting NSEC3-related record in SQLite3 " + "data source without transaction"); + } doUpdate( *dbparameters_, DEL_NSEC3_RECORD, params, "delete NSEC3 record from zone"); diff --git a/src/lib/datasrc/tests/sqlite3_accessor_unittest.cc b/src/lib/datasrc/tests/sqlite3_accessor_unittest.cc index 23c3e54cca..bde3e0f02d 100644 --- a/src/lib/datasrc/tests/sqlite3_accessor_unittest.cc +++ b/src/lib/datasrc/tests/sqlite3_accessor_unittest.cc @@ -1180,6 +1180,10 @@ TEST_F(SQLite3Update, deleteNonexistent) { TEST_F(SQLite3Update, invalidDelete) { // An attempt of delete before an explicit start of transaction EXPECT_THROW(accessor->deleteRecordInZone(del_params), DataSourceError); + + // Same for NSEC3. + EXPECT_THROW(accessor->deleteNSEC3RecordInZone(del_params), + DataSourceError); } TEST_F(SQLite3Update, emptyTransaction) {