From c05f45b7dd83ab582c99a720fd44d6a6ba8ddf32 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 20 Jun 2014 09:00:33 -0700 Subject: [PATCH] Fix multiple subDBs --- libraries/liblmdb/mdb_load.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libraries/liblmdb/mdb_load.c b/libraries/liblmdb/mdb_load.c index 967b0ff..326e8e7 100644 --- a/libraries/liblmdb/mdb_load.c +++ b/libraries/liblmdb/mdb_load.c @@ -300,9 +300,7 @@ int main(int argc, char *argv[]) envname = argv[optind]; rc = mdb_env_create(&env); - if (subname) { - mdb_env_set_maxdbs(env, 2); - } + mdb_env_set_maxdbs(env, 2); rc = mdb_env_open(env, envname, envflags, 0664); if (rc) { @@ -329,7 +327,7 @@ int main(int argc, char *argv[]) goto env_close; } - rc = mdb_open(txn, subname, flags, &dbi); + rc = mdb_open(txn, subname, flags|MDB_CREATE, &dbi); if (rc) { printf("mdb_open failed, error %d %s\n", rc, mdb_strerror(rc)); goto txn_abort;