From 0c357cc88a00bda03aa4a982fc227a5872707df2 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 19 Jul 2019 17:41:12 +0100 Subject: [PATCH 1/6] Release 0.9.24 --- libraries/liblmdb/CHANGES | 2 +- libraries/liblmdb/lmdb.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/liblmdb/CHANGES b/libraries/liblmdb/CHANGES index aa4ae68d71..f00efbb9d4 100644 --- a/libraries/liblmdb/CHANGES +++ b/libraries/liblmdb/CHANGES @@ -1,6 +1,6 @@ LMDB 0.9 Change Log -LMDB 0.9.24 Engineering +LMDB 0.9.24 Release (2019/07/24) ITS#8969 Tweak mdb_page_split ITS#8975 WIN32 fix writemap set_mapsize crash ITS#9007 Fix loose pages in WRITEMAP diff --git a/libraries/liblmdb/lmdb.h b/libraries/liblmdb/lmdb.h index 50ee37fa48..2f55290da8 100644 --- a/libraries/liblmdb/lmdb.h +++ b/libraries/liblmdb/lmdb.h @@ -200,7 +200,7 @@ typedef int mdb_filehandle_t; /** Library minor version */ #define MDB_VERSION_MINOR 9 /** Library patch version */ -#define MDB_VERSION_PATCH 23 +#define MDB_VERSION_PATCH 24 /** Combine args a,b,c into a single integer for easy version comparisons */ #define MDB_VERINT(a,b,c) (((a) << 24) | ((b) << 16) | (c)) @@ -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 "December 19, 2018" +#define MDB_VERSION_DATE "July 24, 2019" /** A stringifier for the version info */ #define MDB_VERSTR(a,b,c,d) "LMDB " #a "." #b "." #c ": (" d ")" From 239d5cd82ba9d9207fec24de2c50a16fc415d6a4 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Mon, 26 Aug 2019 17:51:53 +0100 Subject: [PATCH 2/6] ITS#9068 fix backslash escaping mdb_load wasn't properly inserting escaped backslashes into the data. mdb_dump wasn't escaping backslashes when generating printable output. --- libraries/liblmdb/mdb_dump.c | 2 ++ libraries/liblmdb/mdb_load.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libraries/liblmdb/mdb_dump.c b/libraries/liblmdb/mdb_dump.c index 9df5dc0b16..27c4c19f54 100644 --- a/libraries/liblmdb/mdb_dump.c +++ b/libraries/liblmdb/mdb_dump.c @@ -68,6 +68,8 @@ static void text(MDB_val *v) end = c + v->mv_size; while (c < end) { if (isprint(*c)) { + if (*c == '\\') + putchar('\\'); putchar(*c); } else { putchar('\\'); diff --git a/libraries/liblmdb/mdb_load.c b/libraries/liblmdb/mdb_load.c index 0f177f1ec2..73ffad0555 100644 --- a/libraries/liblmdb/mdb_load.c +++ b/libraries/liblmdb/mdb_load.c @@ -238,7 +238,7 @@ badend: while (c2 < end) { if (*c2 == '\\') { if (c2[1] == '\\') { - c1++; c2 += 2; + *c1++ = *c2; } else { if (c2+3 > end || !isxdigit(c2[1]) || !isxdigit(c2[2])) { Eof = 1; @@ -246,8 +246,8 @@ badend: return EOF; } *c1++ = unhex(++c2); - c2 += 2; } + c2 += 2; } else { /* copies are redundant when no escapes were used */ *c1++ = *c2++; From 5db7e9baaa229b287a60b5232206c3732a320da5 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Mon, 26 Aug 2019 17:56:17 +0100 Subject: [PATCH 3/6] return to release engineering, ITS#9068 --- libraries/liblmdb/CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/liblmdb/CHANGES b/libraries/liblmdb/CHANGES index f00efbb9d4..b84d4eb160 100644 --- a/libraries/liblmdb/CHANGES +++ b/libraries/liblmdb/CHANGES @@ -1,5 +1,8 @@ LMDB 0.9 Change Log +LMDB 0.9.25 Engineering + ITS#9068 fix mdb_dump/load backslashes in printable content + LMDB 0.9.24 Release (2019/07/24) ITS#8969 Tweak mdb_page_split ITS#8975 WIN32 fix writemap set_mapsize crash From 34f572e7a52ffc394040e13e6d14b368176b2b09 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 21 Nov 2019 20:44:37 +0000 Subject: [PATCH 4/6] ITS#9118 add MAP_NOSYNC for FreeBSD --- libraries/liblmdb/mdb.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 692feaa38b..67a739a5be 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -4010,13 +4010,18 @@ mdb_env_map(MDB_env *env, void *addr) if (rc) return rc; #else + int mmap_flags = MAP_SHARED: int prot = PROT_READ; +#ifdef MAP_NOSYNC /* Used on FreeBSD */ + if (flags & MDB_NOSYNC) + mmap_flags |= MAP_NOSYNC; +#endif if (flags & MDB_WRITEMAP) { prot |= PROT_WRITE; if (ftruncate(env->me_fd, env->me_mapsize) < 0) return ErrCode(); } - env->me_map = mmap(addr, env->me_mapsize, prot, MAP_SHARED, + env->me_map = mmap(addr, env->me_mapsize, prot, mmap_flags, env->me_fd, 0); if (env->me_map == MAP_FAILED) { env->me_map = NULL; From 7d0c4b4c30f6f952c0ccb797b0db35188d739b8e Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 21 Nov 2019 20:45:11 +0000 Subject: [PATCH 5/6] ITS#9118 --- libraries/liblmdb/CHANGES | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/liblmdb/CHANGES b/libraries/liblmdb/CHANGES index b84d4eb160..d659ff6328 100644 --- a/libraries/liblmdb/CHANGES +++ b/libraries/liblmdb/CHANGES @@ -2,6 +2,7 @@ LMDB 0.9 Change Log LMDB 0.9.25 Engineering ITS#9068 fix mdb_dump/load backslashes in printable content + ITS#9118 add MAP_NOSYNC for FreeBSD LMDB 0.9.24 Release (2019/07/24) ITS#8969 Tweak mdb_page_split From 8bf3fdcd6d4c6c90bfee5b7346ace9b43f3d5deb Mon Sep 17 00:00:00 2001 From: Quanah Gibson-Mount Date: Fri, 22 Nov 2019 14:36:38 +0000 Subject: [PATCH 6/6] ITS#9118 - Fix typo in prev commit --- 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 67a739a5be..3a0f023d5c 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -4010,7 +4010,7 @@ mdb_env_map(MDB_env *env, void *addr) if (rc) return rc; #else - int mmap_flags = MAP_SHARED: + int mmap_flags = MAP_SHARED; int prot = PROT_READ; #ifdef MAP_NOSYNC /* Used on FreeBSD */ if (flags & MDB_NOSYNC)