summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2018-08-08 23:51:13 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-08-08 23:51:13 +0200
commitb91aedf79c3bb5b803ec9a335baab385a19cbbbc (patch)
tree9caea38119d64539ebbc46d60e61eef3c1035144 /common
parentea78028750bcf6e5ad526763c5916bf39794ae12 (diff)
downloadsink-b91aedf79c3bb5b803ec9a335baab385a19cbbbc.tar.gz
sink-b91aedf79c3bb5b803ec9a335baab385a19cbbbc.zip
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.
Diffstat (limited to 'common')
-rw-r--r--common/storage_lmdb.cpp2
1 files changed, 1 insertions, 1 deletions
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,
164 key.mv_size = db.size(); 164 key.mv_size = db.size();
165 //Store the flags without the create option 165 //Store the flags without the create option
166 const auto ba = QByteArray::number(flags); 166 const auto ba = QByteArray::number(flags);
167 value.mv_data = const_cast<void*>(static_cast<const void*>(db.constData())); 167 value.mv_data = const_cast<void*>(static_cast<const void*>(ba.constData()));
168 value.mv_size = db.size(); 168 value.mv_size = db.size();
169 if (const int rc = mdb_put(transaction, flagtableDbi, &key, &value, MDB_NOOVERWRITE)) { 169 if (const int rc = mdb_put(transaction, flagtableDbi, &key, &value, MDB_NOOVERWRITE)) {
170 //We expect this to fail if we're only creating the dbi but not the db 170 //We expect this to fail if we're only creating the dbi but not the db