Commit 47f14153 authored by JINMEI Tatuya's avatar JINMEI Tatuya

[1891] reject attempt of deleting NSEC3 before start transaction.

parent 9a4619a0
...@@ -1197,8 +1197,10 @@ void ...@@ -1197,8 +1197,10 @@ void
SQLite3Accessor::deleteNSEC3RecordInZone( SQLite3Accessor::deleteNSEC3RecordInZone(
const string (&params)[DEL_PARAM_COUNT]) const string (&params)[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<const string (&)[DEL_PARAM_COUNT]>( doUpdate<const string (&)[DEL_PARAM_COUNT]>(
*dbparameters_, DEL_NSEC3_RECORD, params, *dbparameters_, DEL_NSEC3_RECORD, params,
"delete NSEC3 record from zone"); "delete NSEC3 record from zone");
......
...@@ -1180,6 +1180,10 @@ TEST_F(SQLite3Update, deleteNonexistent) { ...@@ -1180,6 +1180,10 @@ TEST_F(SQLite3Update, deleteNonexistent) {
TEST_F(SQLite3Update, invalidDelete) { TEST_F(SQLite3Update, invalidDelete) {
// An attempt of delete before an explicit start of transaction // An attempt of delete before an explicit start of transaction
EXPECT_THROW(accessor->deleteRecordInZone(del_params), DataSourceError); EXPECT_THROW(accessor->deleteRecordInZone(del_params), DataSourceError);
// Same for NSEC3.
EXPECT_THROW(accessor->deleteNSEC3RecordInZone(del_params),
DataSourceError);
} }
TEST_F(SQLite3Update, emptyTransaction) { TEST_F(SQLite3Update, emptyTransaction) {
......
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