]> git.sur5r.net Git - openldap/commitdiff
ITS#7825 more
authorHoward Chu <hyc@symas.com>
Wed, 9 Jul 2014 04:31:48 +0000 (21:31 -0700)
committerHoward Chu <hyc@symas.com>
Wed, 9 Jul 2014 04:31:48 +0000 (21:31 -0700)
only update dbiseq in dbi_open on write txns

libraries/liblmdb/mdb.c

index c920149611cf1257daff1a3261c5b93703ef5a3b..0520eb72d51dd55fdc55abca99d05066997e64e2 100644 (file)
@@ -8893,7 +8893,9 @@ int mdb_dbi_open(MDB_txn *txn, const char *name, unsigned int flags, MDB_dbi *db
                txn->mt_dbxs[slot].md_name.mv_size = len;
                txn->mt_dbxs[slot].md_rel = NULL;
                txn->mt_dbflags[slot] = dbflag;
-               txn->mt_dbiseqs[slot] = ++txn->mt_env->me_dbiseqs[slot];
+               /* read txns don't track sequence numbers */
+               if (!(txn->mt_flags & MDB_TXN_RDONLY))
+                       txn->mt_dbiseqs[slot] = ++txn->mt_env->me_dbiseqs[slot];
                memcpy(&txn->mt_dbs[slot], data.mv_data, sizeof(MDB_db));
                *dbi = slot;
                mdb_default_cmp(txn, slot);