aboutsummaryrefslogtreecommitdiff
path: root/lmdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'lmdb.c')
-rw-r--r--lmdb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lmdb.c b/lmdb.c
index 1a2c27a..5bcf162 100644
--- a/lmdb.c
+++ b/lmdb.c
@@ -146,7 +146,7 @@ static int txn_begin(lua_State *L, bool nested) {
MDB_txn *txn;
reterr(mdb_txn_begin(
- env, parent, lua_toboolean(L, 2) ? MDB_RDONLY : 0, &txn));
+ env, parent, lua_toboolean(L, 2) || nested ? 0 : MDB_RDONLY, &txn));
struct handle *tud = lua_newuserdata(L, sizeof(struct handle));
tud->closed = false;