From 14a9cdf6005a6a404bd897f3ebfd0b0de28c4137 Mon Sep 17 00:00:00 2001 From: clemahieu Date: Sat, 29 Aug 2015 22:17:10 -0500 Subject: [PATCH] Upgrade LMDB to stock 0.9.16 --- liblmdb/CHANGES | 33 ++ liblmdb/COPYRIGHT | 2 +- liblmdb/lmdb.h | 80 +++-- liblmdb/mdb.c | 665 +++++++++++++++++------------------------ liblmdb/mdb_copy.1 | 2 +- liblmdb/mdb_copy.c | 2 +- liblmdb/mdb_dump.1 | 2 +- liblmdb/mdb_dump.c | 2 +- liblmdb/mdb_load.1 | 2 +- liblmdb/mdb_load.c | 12 +- liblmdb/mdb_stat.1 | 2 +- liblmdb/mdb_stat.c | 2 +- liblmdb/midl.c | 6 +- liblmdb/midl.h | 5 +- liblmdb/mtest.c | 20 +- liblmdb/mtest2.c | 19 +- liblmdb/mtest3.c | 14 +- liblmdb/mtest4.c | 14 +- liblmdb/mtest5.c | 14 +- liblmdb/mtest6.c | 20 +- liblmdb/sample-bdb.txt | 2 +- liblmdb/sample-mdb.txt | 6 +- 22 files changed, 421 insertions(+), 505 deletions(-) diff --git a/liblmdb/CHANGES b/liblmdb/CHANGES index 34049ba7..bc39d82a 100644 --- a/liblmdb/CHANGES +++ b/liblmdb/CHANGES @@ -1,5 +1,38 @@ LMDB 0.9 Change Log +LMDB 0.9.16 Release (2015/08/14) + Fix cursor EOF bug (ITS#8190) + Fix handling of subDB records (ITS#8181) + Fix mdb_midl_shrink() usage (ITS#8200) + +LMDB 0.9.15 Release (2015/06/19) + Fix txn init (ITS#7961,#7987) + Fix MDB_PREV_DUP (ITS#7955,#7671) + Fix compact of empty env (ITS#7956) + Fix mdb_copy file mode + Fix mdb_env_close() after failed mdb_env_open() + Fix mdb_rebalance collapsing root (ITS#8062) + Fix mdb_load with large values (ITS#8066) + Fix to retry writes on EINTR (ITS#8106) + Fix mdb_cursor_del on empty DB (ITS#8109) + Fix MDB_INTEGERDUP key compare (ITS#8117) + Fix error handling (ITS#7959,#8157,etc.) + Fix race conditions (ITS#7969,7970) + Added workaround for fdatasync bug in ext3fs + Build + Don't use -fPIC for static lib + Update .gitignore (ITS#7952,#7953) + Cleanup for "make test" (ITS#7841), "make clean", mtest*.c + Misc. Android/Windows cleanup + Documentation + Fix MDB_APPEND doc + Fix MDB_MAXKEYSIZE doc (ITS#8156) + Fix mdb_cursor_put,mdb_cursor_del EACCES description + Fix mdb_env_sync(MDB_RDONLY env) doc (ITS#8021) + Clarify MDB_WRITEMAP doc (ITS#8021) + Clarify mdb_env_open doc + Clarify mdb_dbi_open doc + LMDB 0.9.14 Release (2014/09/20) Fix to support 64K page size (ITS#7713) Fix to persist decreased as well as increased mapsizes (ITS#7789) diff --git a/liblmdb/COPYRIGHT b/liblmdb/COPYRIGHT index e0eb484c..722d1a51 100644 --- a/liblmdb/COPYRIGHT +++ b/liblmdb/COPYRIGHT @@ -1,4 +1,4 @@ -Copyright 2011-2014 Howard Chu, Symas Corp. +Copyright 2011-2015 Howard Chu, Symas Corp. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/liblmdb/lmdb.h b/liblmdb/lmdb.h index 61318ffd..762dba2e 100644 --- a/liblmdb/lmdb.h +++ b/liblmdb/lmdb.h @@ -49,15 +49,11 @@ * stale locks can block further operation. * * Fix: Check for stale readers periodically, using the - * #mdb_reader_check function or the \ref mdb_stat_1 "mdb_stat" tool. - * Stale writers will be cleared automatically on most systems: - * - Windows - automatic - * - BSD, systems using SysV semaphores - automatic - * - Linux, systems using POSIX mutexes with Robust option - automatic - * Otherwise just make all programs using the database close it; - * the lockfile is always reset on first open of the environment. + * #mdb_reader_check function or the \ref mdb_stat_1 "mdb_stat" tool. Or just + * make all programs using the database close it; the lockfile + * is always reset on first open of the environment. * - * - On BSD systems or others configured with MDB_USE_SYSV_SEM, + * - On BSD systems or others configured with MDB_USE_POSIX_SEM, * startup can fail due to semaphores owned by another userid. * * Fix: Open and close the database as the user which owns the @@ -110,9 +106,6 @@ * for stale readers is performed or the lockfile is reset, * since the process may not remove it from the lockfile. * - * This does not apply to write transactions if the system clears - * stale writers, see above. - * * - If you do that anyway, do a periodic check for stale readers. Or * close the environment once in a while, so the lockfile can get reset. * @@ -126,7 +119,7 @@ * * @author Howard Chu, Symas Corporation. * - * @copyright Copyright 2011-2014 Howard Chu, Symas Corp. All rights reserved. + * @copyright Copyright 2011-2015 Howard Chu, Symas Corp. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted only as authorized by the OpenLDAP @@ -191,7 +184,7 @@ typedef int mdb_filehandle_t; /** Library minor version */ #define MDB_VERSION_MINOR 9 /** Library patch version */ -#define MDB_VERSION_PATCH 14 +#define MDB_VERSION_PATCH 16 /** Combine args a,b,c into a single integer for easy version comparisons */ #define MDB_VERINT(a,b,c) (((a) << 24) | ((b) << 16) | (c)) @@ -201,7 +194,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 "September 20, 2014" +#define MDB_VERSION_DATE "August 14, 2015" /** A stringifier for the version info */ #define MDB_VERSTR(a,b,c,d) "LMDB " #a "." #b "." #c ": (" d ")" @@ -303,12 +296,12 @@ typedef void (MDB_rel_func)(MDB_val *item, void *oldptr, void *newptr, void *rel #define MDB_REVERSEKEY 0x02 /** use sorted duplicates */ #define MDB_DUPSORT 0x04 - /** numeric keys in native byte order. + /** numeric keys in native byte order: either unsigned int or size_t. * The keys must all be of the same size. */ #define MDB_INTEGERKEY 0x08 /** with #MDB_DUPSORT, sorted dup items have fixed size */ #define MDB_DUPFIXED 0x10 - /** with #MDB_DUPSORT, dups are numeric in native byte order */ + /** with #MDB_DUPSORT, dups are #MDB_INTEGERKEY-style integers */ #define MDB_INTEGERDUP 0x20 /** with #MDB_DUPSORT, use reverse string dups */ #define MDB_REVERSEDUP 0x40 @@ -398,7 +391,7 @@ typedef enum MDB_cursor_op { #define MDB_PAGE_NOTFOUND (-30797) /** Located page was wrong type */ #define MDB_CORRUPTED (-30796) - /** Update of meta page failed or environment had fatal error */ + /** Update of meta page failed, probably I/O error */ #define MDB_PANIC (-30795) /** Environment version mismatch */ #define MDB_VERSION_MISMATCH (-30794) @@ -420,7 +413,14 @@ typedef enum MDB_cursor_op { #define MDB_PAGE_FULL (-30786) /** Database contents grew beyond environment mapsize */ #define MDB_MAP_RESIZED (-30785) - /** MDB_INCOMPATIBLE: Operation and DB incompatible, or DB flags changed */ + /** Operation and DB incompatible, or DB type changed. This can mean: + * + */ #define MDB_INCOMPATIBLE (-30784) /** Invalid reuse of reader locktable slot */ #define MDB_BAD_RSLOT (-30783) @@ -595,8 +595,8 @@ int mdb_env_create(MDB_env **env); * reserved in that case. * This flag may be changed at any time using #mdb_env_set_flags(). * - * @param[in] mode The UNIX permissions to set on created files. This parameter - * is ignored on Windows. + * @param[in] mode The UNIX permissions to set on created files and semaphores. + * This parameter is ignored on Windows. * @return A non-zero error value on failure and 0 on success. Some possible * errors are: *