]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
and generic sql too
authorBert Hubert <bert.hubert@netherlabs.nl>
Tue, 25 Jan 2011 19:13:06 +0000 (19:13 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Tue, 25 Jan 2011 19:13:06 +0000 (19:13 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1907 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/backends/gsql/gsqlbackend.cc

index b0c9d0435ae12f7f2c3d7d0a6c0a31a93bab8fe6..deabb575f2728b70bc5b289bcfe414f39f253d53 100644 (file)
@@ -673,10 +673,12 @@ bool GSQLBackend::feedRecord(const DNSResourceRecord &r)
 bool GSQLBackend::startTransaction(const string &domain, int domain_id)
 {
   char output[1024];
-  snprintf(output,sizeof(output)-1,d_DeleteZoneQuery.c_str(),domain_id);
+  if(domain_id >= 0) 
+   snprintf(output,sizeof(output)-1,d_DeleteZoneQuery.c_str(),domain_id);
   try {
     d_db->doCommand("begin");
-    d_db->doCommand(output);
+    if(domain_id >= 0)
+     d_db->doCommand(output);
   }
   catch (SSqlException &e) {
     throw AhuException("Database failed to start transaction: "+e.txtReason());