]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
b2b-migrate did not open a transaction, breaking it for lmdb 7696/head
authorahu@ds9a.nl <ahu@ds9a.nl>
Wed, 10 Apr 2019 07:44:48 +0000 (07:44 +0000)
committerahu@ds9a.nl <ahu@ds9a.nl>
Wed, 10 Apr 2019 07:44:48 +0000 (07:44 +0000)
pdns/pdnsutil.cc

index 9556faf19f5626028f9c8b7a73e865807509c518..eb8f5c96c86335866b1dcfa53c656d0f81918a95 100644 (file)
@@ -3200,11 +3200,15 @@ try
       // move records
       if (!src->list(di.zone, di.id, true)) throw PDNSException("Failed to list records");
       nr=0;
+
+      tgt->startTransaction(di.zone, di_new.id);
+
       while(src->get(rr)) {
         rr.domain_id = di_new.id;
         if (!tgt->feedRecord(rr, DNSName())) throw PDNSException("Failed to feed record");
         nr++;
       }
+
       // move comments
       nc=0;
       if (src->listComments(di.id)) {
@@ -3235,6 +3239,7 @@ try
           nk++;
         }
       }
+      tgt->commitTransaction();
       cout<<"Moved "<<nr<<" record(s), "<<nc<<" comment(s), "<<nm<<" metadata(s) and "<<nk<<" cryptokey(s)"<<endl;
     }