ITS#7660 Add mdb_txn_env to API

vmware
Salvador Ortiz 11 years ago committed by Howard Chu
parent 5645812f41
commit 86551828ab
  1. 6
      libraries/liblmdb/lmdb.h
  2. 7
      libraries/liblmdb/mdb.c

@ -762,6 +762,12 @@ int mdb_env_get_maxkeysize(MDB_env *env);
*/ */
int mdb_txn_begin(MDB_env *env, MDB_txn *parent, unsigned int flags, MDB_txn **txn); int mdb_txn_begin(MDB_env *env, MDB_txn *parent, unsigned int flags, MDB_txn **txn);
/** @brief Returns the transaction's #MDB_env
*
* @param[in] txn A transaction handle returned by #mdb_txn_begin()
*/
MDB_env *mdb_txn_env(MDB_txn *txn);
/** @brief Commit all the operations of a transaction into the database. /** @brief Commit all the operations of a transaction into the database.
* *
* The transaction handle is freed. It and its cursors must not be used * The transaction handle is freed. It and its cursors must not be used

@ -2307,6 +2307,13 @@ mdb_txn_begin(MDB_env *env, MDB_txn *parent, unsigned int flags, MDB_txn **ret)
return rc; return rc;
} }
MDB_env *
mdb_txn_env(MDB_txn *txn)
{
if(!txn) return NULL;
return txn->mt_env;
}
/** Export or close DBI handles opened in this txn. */ /** Export or close DBI handles opened in this txn. */
static void static void
mdb_dbis_update(MDB_txn *txn, int keep) mdb_dbis_update(MDB_txn *txn, int keep)

Loading…
Cancel
Save