return false;
}
- string stmt = getArg( "sql-zonedelete" );
- stmtref = strbind( ":id", string( m_buffer, len ), stmt );
- if( !execStmt( stmtref.c_str(), stmtref.size(), WRITE ) ) { return false; }
+ if(zoneid >= 0) {
+ string stmt = getArg( "sql-zonedelete" );
+ stmtref = strbind( ":id", string( m_buffer, len ), stmt );
+ if( !execStmt( stmtref.c_str(), stmtref.size(), WRITE ) ) { return false; }
+ }
}
catch ( exception& e )
{
bool PdnsBackend::startTransaction(const string &qname, int domain_id)
{
+
ostringstream o;
o << "delete from Records where ZoneId=" << domain_id;
this->Execute("begin");
- this->Execute(o.str());
+ if(domain_id >= 0)
+ this->Execute(o.str());
d_axfrcount = 0;
bool Bind2Backend::startTransaction(const string &qname, int id)
{
+ if(id < 0) {
+ d_transaction_tmpname.clear();
+ d_transaction_id=id;
+ return true;
+ }
shared_ptr<State> state = getState();
const BB2DomainInfo &bbd=state->id_zone_map[d_transaction_id=id];
bool Bind2Backend::commitTransaction()
{
+ if(d_transaction_id < 0)
+ return true;
delete d_of;
d_of=0;
shared_ptr<State> state = getState();
bool Bind2Backend::abortTransaction()
{
- if(d_transaction_id) {
+ if(d_transaction_id >= 0) {
delete d_of;
d_of=0;
unlink(d_transaction_tmpname.c_str());