iterator_type_(qtype == QT_NSEC3 ? ITT_NSEC3 : ITT_NAME),
accessor_(accessor),
statement_(NULL),
+ statement2_(NULL),
+ rc_(SQLITE_OK),
+ rc2_(SQLITE_OK),
name_(name)
{
- // Choose the statement text depending on the query type
- const char* statement(NULL);
+ // Choose the statement text depending on the query type, and
+ // prepare a statement to get data from it.
switch (qtype) {
case QT_ANY:
- statement = text_statements[ANY];
+ statement_ = prepare(accessor->dbparameters_->db_,
+ text_statements[ANY]);
+ bindZoneId(id);
+ bindName(name_);
break;
case QT_SUBDOMAINS:
- statement = text_statements[ANY_SUB];
+ statement_ = prepare(accessor->dbparameters_->db_,
+ text_statements[ANY_SUB]);
+ bindZoneId(id);
+ // Done once, this should not be very inefficient.
+ bindName(isc::dns::Name(name_).reverse().toText() + "%");
break;
case QT_NSEC3:
- statement = text_statements[NSEC3];
+ statement_ = prepare(accessor->dbparameters_->db_,
+ text_statements[NSEC3]);
+ bindZoneId(id);
+ bindName(name_);
break;
default:
// Can Not Happen - there isn't any other type of query