Commit 8662231f authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[2877] Comments and documentation

For the previous commit, adding the reverse name to the list of
parameters for delete.
parent b8387e4c
......@@ -127,7 +127,8 @@ public:
///< or the hash label for deleteNSEC3RecordInZone()
DEL_TYPE = 1, ///< The RRType of the record (A/NS/TXT etc.)
DEL_RDATA = 2, ///< Full text representation of the record's RDATA
DEL_RNAME = 3,
DEL_RNAME = 3, ///< As DEL_NAME, but with the labels of domain name
///< in reverse order (eg. org.example.).
DEL_PARAM_COUNT = 4 ///< Number of parameters
};
......
......@@ -104,6 +104,8 @@ const char* const text_statements[NUM_STATEMENTS] = {
"INSERT INTO records " // ADD_RECORD
"(zone_id, name, rname, ttl, rdtype, sigtype, rdata) "
"VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7)",
// DEL_RECORD:
// Delete based on the reverse name, as that one has an index.
"DELETE FROM records WHERE zone_id=?1 AND rname=?2 " // DEL_RECORD
"AND rdtype=?3 AND rdata=?4",
......@@ -1295,6 +1297,8 @@ SQLite3Accessor::deleteRecordInZone(const string (&params)[DEL_PARAM_COUNT]) {
isc_throw(DataSourceError, "deleting record in SQLite3 "
"data source without transaction");
}
// We don't pass all the parameters to the query, one name (reserve one
// in this case) is sufficient. Pass only the needed ones.
const size_t SQLITE3_DEL_PARAM_COUNT = DEL_PARAM_COUNT - 1;
const string sqlite3_params[SQLITE3_DEL_PARAM_COUNT] = {
params[DEL_RNAME],
......
Supports Markdown
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