From b91aedf79c3bb5b803ec9a335baab385a19cbbbc Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 8 Aug 2018 23:51:13 +0200 Subject: Actually store the flags instead of the db name. The reason why we didn't notice was probably: * we only use this table nowadays when we have no db layout. * The only flag we ever set is the dupsort flag, and the return from a failed int conversion of 0 is otherwise correct. --- common/storage_lmdb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/storage_lmdb.cpp b/common/storage_lmdb.cpp index 3fee2a9..a007405 100644 --- a/common/storage_lmdb.cpp +++ b/common/storage_lmdb.cpp @@ -164,7 +164,7 @@ static bool createDbi(MDB_txn *transaction, const QByteArray &db, bool readOnly, key.mv_size = db.size(); //Store the flags without the create option const auto ba = QByteArray::number(flags); - value.mv_data = const_cast(static_cast(db.constData())); + value.mv_data = const_cast(static_cast(ba.constData())); value.mv_size = db.size(); if (const int rc = mdb_put(transaction, flagtableDbi, &key, &value, MDB_NOOVERWRITE)) { //We expect this to fail if we're only creating the dbi but not the db -- cgit v1.2.3