diff options
-rw-r--r-- | common/storage_lmdb.cpp | 2 | ||||
-rw-r--r-- | tests/storagetest.cpp | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/common/storage_lmdb.cpp b/common/storage_lmdb.cpp index 23df0fc..983d0e2 100644 --- a/common/storage_lmdb.cpp +++ b/common/storage_lmdb.cpp | |||
@@ -317,7 +317,7 @@ Storage::Private::Private(const QString &s, const QString &n, AccessMode m, bool | |||
317 | // TODO: handle error | 317 | // TODO: handle error |
318 | std::cerr << "mdb_env_create: " << rc << " " << mdb_strerror(rc) << std::endl; | 318 | std::cerr << "mdb_env_create: " << rc << " " << mdb_strerror(rc) << std::endl; |
319 | } else { | 319 | } else { |
320 | if ((rc = mdb_env_open(env, fullPath.toStdString().data(), mode == ReadOnly ? MDB_RDONLY : 0 , 0664))) { | 320 | if ((rc = mdb_env_open(env, fullPath.toStdString().data(), mode == ReadOnly ? MDB_RDONLY : 0 | MDB_NOTLS, 0664))) { |
321 | std::cerr << "mdb_env_open: " << rc << " " << mdb_strerror(rc) << std::endl; | 321 | std::cerr << "mdb_env_open: " << rc << " " << mdb_strerror(rc) << std::endl; |
322 | mdb_env_close(env); | 322 | mdb_env_close(env); |
323 | env = 0; | 323 | env = 0; |
diff --git a/tests/storagetest.cpp b/tests/storagetest.cpp index b71a767..55ec888 100644 --- a/tests/storagetest.cpp +++ b/tests/storagetest.cpp | |||
@@ -142,6 +142,18 @@ private Q_SLOTS: | |||
142 | }); | 142 | }); |
143 | } | 143 | } |
144 | 144 | ||
145 | void testNestedTransactions() | ||
146 | { | ||
147 | populate(3); | ||
148 | Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite); | ||
149 | store.createTransaction(Akonadi2::Storage::ReadOnly).scan("key1", [&](const QByteArray &key, const QByteArray &value) -> bool { | ||
150 | store.createTransaction(Akonadi2::Storage::ReadWrite).remove(key, [](const Akonadi2::Storage::Error &) { | ||
151 | QVERIFY(false); | ||
152 | }); | ||
153 | return false; | ||
154 | }); | ||
155 | } | ||
156 | |||
145 | void testReadEmptyDb() | 157 | void testReadEmptyDb() |
146 | { | 158 | { |
147 | bool gotResult = false; | 159 | bool gotResult = false; |