Skip to content

Commit

Permalink
Merge pull request #13 from wojas/upgrade-lmdb-0-9-29
Browse files Browse the repository at this point in the history
Upgrade LMDB C lib from 0.9.28 to 0.9.29
  • Loading branch information
wojas authored Feb 22, 2022
2 parents 41b4826 + 59301d7 commit 3dbfafc
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
4 changes: 4 additions & 0 deletions CHANGES.lmdb.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
LMDB 0.9 Change Log

LMDB 0.9.29 Release (2021/03/16)
ITS#9461 refix ITS#9376
ITS#9500 fix regression from ITS#8662

LMDB 0.9.28 Release (2021/02/04)
ITS#8662 add -a append option to mdb_load

Expand Down
8 changes: 4 additions & 4 deletions lmdb/lmdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ typedef int mdb_filehandle_t;
/** Library minor version */
#define MDB_VERSION_MINOR 9
/** Library patch version */
#define MDB_VERSION_PATCH 28
#define MDB_VERSION_PATCH 29

/** Combine args a,b,c into a single integer for easy version comparisons */
#define MDB_VERINT(a,b,c) (((a) << 24) | ((b) << 16) | (c))
Expand All @@ -210,7 +210,7 @@ typedef int mdb_filehandle_t;
MDB_VERINT(MDB_VERSION_MAJOR,MDB_VERSION_MINOR,MDB_VERSION_PATCH)

/** The release date of this library version */
#define MDB_VERSION_DATE "February 4, 2020"
#define MDB_VERSION_DATE "March 16, 2021"

/** A stringifier for the version info */
#define MDB_VERSTR(a,b,c,d) "LMDB " #a "." #b "." #c ": (" d ")"
Expand Down Expand Up @@ -576,7 +576,7 @@ int mdb_env_create(MDB_env **env);
* <li>#MDB_NOTLS
* Don't use Thread-Local Storage. Tie reader locktable slots to
* #MDB_txn objects instead of to threads. I.e. #mdb_txn_reset() keeps
* the slot reseved for the #MDB_txn object. A thread may use parallel
* the slot reserved for the #MDB_txn object. A thread may use parallel
* read-only transactions. A read-only transaction may span threads if
* the user synchronizes its use. Applications that multiplex many
* user threads over individual OS threads need this option. Such an
Expand Down Expand Up @@ -928,7 +928,7 @@ void *mdb_env_get_userctx(MDB_env *env);
typedef void MDB_assert_func(MDB_env *env, const char *msg);

/** Set or reset the assert() callback of the environment.
* Disabled if liblmdb is buillt with NDEBUG.
* Disabled if liblmdb is built with NDEBUG.
* @note This hack should become obsolete as lmdb's error handling matures.
* @param[in] env An environment handle returned by #mdb_env_create().
* @param[in] func An #MDB_assert_func function, or 0.
Expand Down
28 changes: 13 additions & 15 deletions lmdb/mdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ static txnid_t mdb_debug_start;
* The string is printed literally, with no format processing.
*/
#define DPUTS(arg) DPRINTF(("%s", arg))
/** Debuging output value of a cursor DBI: Negative in a sub-cursor. */
/** Debugging output value of a cursor DBI: Negative in a sub-cursor. */
#define DDBI(mc) \
(((mc)->mc_flags & C_SUB) ? -(int)(mc)->mc_dbi : (int)(mc)->mc_dbi)
/** @} */
Expand Down Expand Up @@ -6992,7 +6992,7 @@ mdb_cursor_put(MDB_cursor *mc, MDB_val *key, MDB_val *data,
xdata.mv_size = 0;
xdata.mv_data = "";
leaf = NODEPTR(mc->mc_pg[mc->mc_top], mc->mc_ki[mc->mc_top]);
if (flags == MDB_CURRENT) {
if ((flags & (MDB_CURRENT|MDB_APPENDDUP)) == MDB_CURRENT) {
xflags = MDB_CURRENT|MDB_NOSPILL;
} else {
mdb_xcursor_init1(mc, leaf);
Expand Down Expand Up @@ -8481,7 +8481,6 @@ mdb_cursor_del0(MDB_cursor *mc)
return rc;
}

ki = mc->mc_ki[mc->mc_top];
mp = mc->mc_pg[mc->mc_top];
nkeys = NUMKEYS(mp);

Expand All @@ -8493,19 +8492,18 @@ mdb_cursor_del0(MDB_cursor *mc)
if (m3->mc_snum < mc->mc_snum)
continue;
if (m3->mc_pg[mc->mc_top] == mp) {
if (m3->mc_ki[mc->mc_top] >= mc->mc_ki[mc->mc_top]) {
/* if m3 points past last node in page, find next sibling */
if (m3->mc_ki[mc->mc_top] >= nkeys) {
rc = mdb_cursor_sibling(m3, 1);
if (rc == MDB_NOTFOUND) {
m3->mc_flags |= C_EOF;
rc = MDB_SUCCESS;
continue;
if (m3->mc_ki[mc->mc_top] >= nkeys) {
rc = mdb_cursor_sibling(m3, 1);
if (rc == MDB_NOTFOUND) {
m3->mc_flags |= C_EOF;
rc = MDB_SUCCESS;
continue;
}
if (rc)
goto fail;
}
if (rc)
goto fail;
}
if (m3->mc_ki[mc->mc_top] >= ki ||
/* moved to right sibling */ m3->mc_pg[mc->mc_top] != mp) {
if (m3->mc_xcursor && !(m3->mc_flags & C_EOF)) {
MDB_node *node = NODEPTR(m3->mc_pg[m3->mc_top], m3->mc_ki[m3->mc_top]);
/* If this node has dupdata, it may need to be reinited
Expand All @@ -8527,10 +8525,10 @@ mdb_cursor_del0(MDB_cursor *mc)
}
m3->mc_xcursor->mx_cursor.mc_flags |= C_DEL;
}
m3->mc_flags |= C_DEL;
}
}
}
mc->mc_flags |= C_DEL;

fail:
if (rc)
Expand Down

0 comments on commit 3dbfafc

Please sign in to comment.