From: Howard Chu Date: Fri, 5 Dec 2014 19:15:41 +0000 (+0000) Subject: ITS#7994 fix prev commit X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c36c167cc49a59d4f40ae5fc259c013de601164e;p=openldap ITS#7994 fix prev commit Strip docs promising behaviors that we don't promise to hold. Strip MDB_txnid_t typedef. --- diff --git a/libraries/liblmdb/lmdb.h b/libraries/liblmdb/lmdb.h index 803b28618b..621a8f6e23 100644 --- a/libraries/liblmdb/lmdb.h +++ b/libraries/liblmdb/lmdb.h @@ -226,9 +226,6 @@ typedef struct MDB_env MDB_env; */ typedef struct MDB_txn MDB_txn; -/** @brief Unique identifier for an active or recent transaction. */ -typedef size_t MDB_txnid_t; - /** @brief A handle for an individual database in the DB environment. */ typedef unsigned int MDB_dbi; @@ -451,7 +448,7 @@ typedef struct MDB_envinfo { void *me_mapaddr; /**< Address of map, if fixed */ size_t me_mapsize; /**< Size of the data memory map */ size_t me_last_pgno; /**< ID of the last used page */ - MDB_txnid_t me_last_txnid; /**< ID of the last committed transaction */ + size_t me_last_txnid; /**< ID of the last committed transaction */ unsigned int me_maxreaders; /**< max reader slots in the environment */ unsigned int me_numreaders; /**< max reader slots used in the environment */ } MDB_envinfo; @@ -953,18 +950,16 @@ int mdb_txn_begin(MDB_env *env, MDB_txn *parent, unsigned int flags, MDB_txn ** */ MDB_env *mdb_txn_env(MDB_txn *txn); - /** @brief Return the transaction's #MDB_txnid_t + /** @brief Return the transaction's ID. * * This returns the identifier associated with this transaction. For a * read-only transaction, this corresponds to the snapshot being read; - * concurrent readers will frequently have the same transaction ID. For - * a write transaction, this is always the snapshot read plus one. When - * a write transaction aborts, the next transaction ID will be reused. + * concurrent readers will frequently have the same transaction ID. * * @param[in] txn A transaction handle returned by #mdb_txn_begin() * @return A transaction ID, valid if input is an active transaction. */ -MDB_txnid_t mdb_txn_id(MDB_txn *txn); +size_t mdb_txn_id(MDB_txn *txn); /** @brief Commit all the operations of a transaction into the database. * diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 87aa4f8cee..f61bbdf6ed 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -2775,10 +2775,10 @@ mdb_txn_env(MDB_txn *txn) return txn->mt_env; } -MDB_txnid_t +size_t mdb_txn_id(MDB_txn *txn) { - if(!txn) return (txnid_t)-1; + if(!txn) return 0; return txn->mt_txnid; }