From: Hallvard Furuseth Date: Thu, 18 Apr 2013 02:15:45 +0000 (+0200) Subject: Support mdb_txn_abort(a reset txn). X-Git-Tag: OPENLDAP_REL_ENG_2_4_36~69^2~7 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=8a562f560edcc6417672df453c4e626dfb4c4024;p=openldap Support mdb_txn_abort(a reset txn). --- diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index f1ed1f232a..72ffa7e587 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -1980,6 +1980,7 @@ mdb_txn_begin(MDB_env *env, MDB_txn *parent, unsigned int flags, MDB_txn **ret) } /** Common code for #mdb_txn_reset() and #mdb_txn_abort(). + * May be called twice for readonly txns: First reset it, then abort. * @param[in] txn the transaction handle to reset */ static void @@ -2001,7 +2002,9 @@ mdb_txn_reset0(MDB_txn *txn) if (F_ISSET(txn->mt_flags, MDB_TXN_RDONLY)) { if (txn->mt_u.reader) { txn->mt_u.reader->mr_txnid = (txnid_t)-1; + txn->mt_u.reader = NULL; /* do not touch mr_txnid again */ } + txn->mt_numdbs = 0; /* mark txn as reset, do not close DBs again */ } else { MDB_page *dp;