From ada26306992babeccad0c5443fbd76e28dd24cd6 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 7 Aug 2014 11:06:53 -0700 Subject: [PATCH 1/3] Just use memalign, not posix_memalign Everything has it. Solaris doesn't have posix_memalign. --- libraries/liblmdb/mdb.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 8b560ed32e..6a95f31d50 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -85,6 +85,7 @@ extern int cacheflush(char *addr, int nbytes, int cache); #include #include #include +#include #include #include #include @@ -8469,9 +8470,9 @@ mdb_env_copyfd1(MDB_env *env, HANDLE fd) #else pthread_mutex_init(&my.mc_mutex, NULL); pthread_cond_init(&my.mc_cond, NULL); - rc = posix_memalign((void **)&my.mc_wbuf[0], env->me_os_psize, MDB_WBUF*2); - if (rc) - return rc; + my.mc_wbuf[0] = memalign(env->me_os_psize, MDB_WBUF*2); + if (my.mc_wbuf[0] == NULL) + return errno; #endif memset(my.mc_wbuf[0], 0, MDB_WBUF*2); my.mc_wbuf[1] = my.mc_wbuf[0] + MDB_WBUF; From 322cd26a7bc92fecb92ce92aa49ac5b342ebde50 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Mon, 11 Aug 2014 11:00:11 -0700 Subject: [PATCH 2/3] ITS#7917 fix mdb_dbi_open Don't let dummy go out of scope --- libraries/liblmdb/mdb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 6a95f31d50..47a503636c 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -8892,6 +8892,7 @@ int mdb_dbi_open(MDB_txn *txn, const char *name, unsigned int flags, MDB_dbi *db MDB_val key, data; MDB_dbi i; MDB_cursor mc; + MDB_db dummy; int rc, dbflag, exact; unsigned int unused = 0, seq; size_t len; @@ -8961,7 +8962,6 @@ int mdb_dbi_open(MDB_txn *txn, const char *name, unsigned int flags, MDB_dbi *db return MDB_INCOMPATIBLE; } else if (rc == MDB_NOTFOUND && (flags & MDB_CREATE)) { /* Create if requested */ - MDB_db dummy; data.mv_size = sizeof(MDB_db); data.mv_data = &dummy; memset(&dummy, 0, sizeof(dummy)); From 992a96e17163d0098f652389a2571f6c31a295c5 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Mon, 11 Aug 2014 11:01:20 -0700 Subject: [PATCH 3/3] ITS#7917 --- libraries/liblmdb/CHANGES | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/liblmdb/CHANGES b/libraries/liblmdb/CHANGES index 644b18de97..11dc2ec864 100644 --- a/libraries/liblmdb/CHANGES +++ b/libraries/liblmdb/CHANGES @@ -9,6 +9,7 @@ LMDB 0.9.14 Engineering Fix mdb_copy copying past end of file (ITS#7886) Fix cursor bugs from page_merge/rebalance Fix to dirty fewer pages in deletes (mdb_page_loose()) + Fix mdb_dbi_open creating subDBs (ITS#7917) Fix Windows compat issues in mtests (ITS#7879) Add compacting variant of mdb_copy Add BigEndian integer key compare code