]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
remove pdnsutil lmdb-get-schema-version, it breaks building with dynmodule lmdb
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Fri, 17 Mar 2023 09:09:19 +0000 (10:09 +0100)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Fri, 17 Mar 2023 09:09:19 +0000 (10:09 +0100)
modules/lmdbbackend/lmdbbackend.cc
pdns/pdnsutil.cc

index 84b91c00bbcf43d170932f501f9fc190f5f63fb7..9e51159cb4a5d7f0064fdac2a6e1d6094a86b9a5 100644 (file)
@@ -20,6 +20,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
+#include <lmdb.h>
+#include <utility>
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
index e9337ddde0e511ff90e9abbaffbbd521e743e7b1..f1fa3489548bca69f4e22349b8c783fab87c908b 100644 (file)
@@ -1,5 +1,4 @@
 
-#include "modules/lmdbbackend/lmdbbackend.hh"
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -1518,7 +1517,6 @@ static int createZone(const DNSName &zone, const DNSName& nsname) {
     return EXIT_FAILURE;
   }
 
-  cerr<<"di.id="<<di.id<<endl;
   rr.domain_id = di.id;
   di.backend->startTransaction(zone, di.id);
   di.backend->feedRecord(rr, DNSName());
@@ -2644,6 +2642,7 @@ try
     cout << "test-schema ZONE                   Test DB schema - will create ZONE" << endl;
     cout << "raw-lua-from-content TYPE CONTENT  Display record contents in a form suitable for dnsdist's `SpoofRawAction`" << endl;
     cout << "zonemd-verify-file ZONE FILE       Validate ZONEMD for ZONE" << endl;
+    cout << "lmdb-get-backend-version           Get schema version supported by backend" << endl;
     cout << desc << endl;
 
     return 0;
@@ -2651,18 +2650,8 @@ try
 
   loadMainConfig(g_vm["config-dir"].as<string>());
 
-  if (cmds.at(0) == "lmdb-get-schema-version") {
-    // FIXME: add command to help
-    if(cmds.size() != 2) {
-      cerr << "Syntax: pdnsutil lmdb-get-schema-version /path/to/pdns.lmdb"<<endl;
-      return 0;
-    }
-
-    auto res = LMDBBackend::getSchemaVersionAndShards(cmds.at(1));
-    cerr << "schemaversion: "<<res.first<<endl;
-    cerr << "shards: "<<res.second<<endl;
-    cout << res.first <<endl;
-
+  if (cmds.at(0) == "lmdb-get-backend-version") {
+    cout << "5" << endl; // FIXME this should reuse the constant from lmdbbackend but that is currently a #define in a .cc
     return 0;
   }
   if (cmds.at(0) == "test-algorithm") {