ITS#7825 more

only update dbiseq in dbi_open on write txns
robust
Howard Chu 11 years ago
parent 04851e442f
commit 276aa55969
  1. 2
      libraries/liblmdb/mdb.c

@ -8893,6 +8893,8 @@ 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_name.mv_size = len;
txn->mt_dbxs[slot].md_rel = NULL; txn->mt_dbxs[slot].md_rel = NULL;
txn->mt_dbflags[slot] = dbflag; txn->mt_dbflags[slot] = dbflag;
/* read txns don't track sequence numbers */
if (!(txn->mt_flags & MDB_TXN_RDONLY))
txn->mt_dbiseqs[slot] = ++txn->mt_env->me_dbiseqs[slot]; txn->mt_dbiseqs[slot] = ++txn->mt_env->me_dbiseqs[slot];
memcpy(&txn->mt_dbs[slot], data.mv_data, sizeof(MDB_db)); memcpy(&txn->mt_dbs[slot], data.mv_data, sizeof(MDB_db));
*dbi = slot; *dbi = slot;

Loading…
Cancel
Save