Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CHANGES.lmdb.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
LMDB 0.9 Change Log

LMDB 0.9.35 Release (2026/01/27)
ITS#10434 - Fix typo affecting Mac OSX

LMDB 0.9.34 Release (2026/01/26)
ITS#9564 - fix race condition freeing spilled pages at end of transaction
ITS#10222 - Update mdb_dump(1) and mdb_load(1) man pages for append (-a) option
ITS#10275 - mdb_load: add -Q option to use NOSYNC
ITS#10296 - fix fdatasync on MacOS
ITS#10342 - fix memleak in mdb_txn_begin for nested txns
ITS#10346 - fix mdb_env_copy2 with values > (2GB-16)
ITS#10355 - fix mplay build on musl
ITS#10396 - fix mdb_cursor_del0 with multiple DUPSORT cursors
ITS#10419 - add support for NetBSD
ITS#10420 - add support for Haiku
ITS#10421 - mdb_load: check for malicious input

LMDB 0.9.33 Release (2024/05/21)
ITS#9037 mdb_page_search: fix error code when DBI record is missing
ITS#10198 For win32, stop passing ignored parameter
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# lmdb-go [![releases/v1.9.2](https://img.shields.io/badge/release-v1.9.2-375eab.svg)](https://github.com/PowerDNS/lmdb-go/releases) [![C/v0.9.31](https://img.shields.io/badge/C-v0.9.31-555555.svg)](https://github.com/LMDB/lmdb/blob/mdb.RE/0.9/libraries/liblmdb/CHANGES) [![Build Status](https://github.com/PowerDNS/lmdb-go/actions/workflows/go.yml/badge.svg?branch=master)]
# lmdb-go [![releases/v1.9.4](https://img.shields.io/badge/release-v1.9.4-375eab.svg)](https://github.com/PowerDNS/lmdb-go/releases) [![C/v0.9.35](https://img.shields.io/badge/C-v0.9.35-555555.svg)](https://github.com/LMDB/lmdb/blob/mdb.RE/0.9/libraries/liblmdb/CHANGES) [![Build Status](https://github.com/PowerDNS/lmdb-go/actions/workflows/go.yml/badge.svg?branch=master)]
Comment thread
wojas marked this conversation as resolved.
Resolved

Go bindings to the OpenLDAP Lightning Memory-Mapped Database (LMDB).

Expand Down
4 changes: 2 additions & 2 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 33
#define MDB_VERSION_PATCH 35

/** 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 "May 21, 2024"
#define MDB_VERSION_DATE "Jan 27, 2026"

/** A stringifier for the version info */
#define MDB_VERSTR(a,b,c,d) "LMDB " #a "." #b "." #c ": (" d ")"
Expand Down
31 changes: 23 additions & 8 deletions lmdb/mdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,21 @@ typedef SSIZE_T ssize_t;
# define MDB_USE_ROBUST 1
#elif defined(__APPLE__) || defined (BSD) || defined(__FreeBSD_kernel__)
# define MDB_USE_POSIX_SEM 1
# define MDB_FDATASYNC fsync
# if defined(__APPLE__)
# define MDB_FDATASYNC(fd) fcntl(fd, F_FULLFSYNC)
# else
# define MDB_FDATASYNC fsync
# endif
#elif defined(ANDROID)
# define MDB_FDATASYNC fsync
#elif defined(__HAIKU__)
# define MDB_USE_POSIX_SEM 1
# define MDB_FDATASYNC fsync
#endif

/* NetBSD does not define union semun in sys/sem.h */
#if defined(__NetBSD__) && !defined(_SEM_SEMUN_UNDEFINED)
# define _SEM_SEMUN_UNDEFINED 1
#endif

#ifndef _WIN32
Expand Down Expand Up @@ -2573,7 +2585,7 @@ mdb_env_sync(MDB_env *env, int force)
? MS_ASYNC : MS_SYNC;
if (MDB_MSYNC(env->me_map, env->me_mapsize, flags))
rc = ErrCode();
#ifdef _WIN32
#if defined(_WIN32) || defined(__APPLE__)
else if (flags == MS_SYNC && MDB_FDATASYNC(env->me_fd))
rc = ErrCode();
#endif
Expand Down Expand Up @@ -2970,8 +2982,10 @@ mdb_txn_begin(MDB_env *env, MDB_txn *parent, unsigned int flags, MDB_txn **ret)
rc = mdb_txn_renew0(txn);
}
if (rc) {
if (txn != env->me_txn0)
if (txn != env->me_txn0) {
free(txn->mt_u.dirty_list);
free(txn);
}
Comment on lines 2984 to +2988

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an upstream bug in 0.9.34 and .35, created #44 to track. No action planned in this PR.

} else {
txn->mt_flags |= flags; /* could not change txn=me_txn0 earlier */
*ret = txn;
Expand Down Expand Up @@ -3072,6 +3086,7 @@ mdb_txn_end(MDB_txn *txn, unsigned mode)

txn->mt_numdbs = 0;
txn->mt_flags = MDB_TXN_FINISHED;
mdb_midl_free(txn->mt_spill_pgs);

if (!txn->mt_parent) {
mdb_midl_shrink(&txn->mt_free_pgs);
Expand All @@ -3093,7 +3108,6 @@ mdb_txn_end(MDB_txn *txn, unsigned mode)
mdb_midl_free(txn->mt_free_pgs);
free(txn->mt_u.dirty_list);
}
mdb_midl_free(txn->mt_spill_pgs);

mdb_midl_free(pghead);
}
Expand Down Expand Up @@ -8602,7 +8616,7 @@ mdb_cursor_del0(MDB_cursor *mc)
goto fail;
}
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]);
MDB_node *node = NODEPTR(m3->mc_pg[mc->mc_top], m3->mc_ki[mc->mc_top]);
/* If this node has dupdata, it may need to be reinited
* because its data has moved.
* If the xcursor was not initd it must be reinited.
Expand Down Expand Up @@ -9170,8 +9184,8 @@ typedef struct mdb_copy {
pthread_cond_t mc_cond; /**< Condition variable for #mc_new */
char *mc_wbuf[2];
char *mc_over[2];
int mc_wlen[2];
int mc_olen[2];
size_t mc_wlen[2];
size_t mc_olen[2];
pgno_t mc_next_pgno;
HANDLE mc_fd;
int mc_toggle; /**< Buffer number in provider */
Expand All @@ -9188,7 +9202,8 @@ mdb_env_copythr(void *arg)
{
mdb_copy *my = arg;
char *ptr;
int toggle = 0, wsize, rc;
int toggle = 0, rc;
size_t wsize;
#ifdef _WIN32
DWORD len;
#define DO_WRITE(rc, fd, ptr, w2, len) rc = WriteFile(fd, ptr, w2, &len, NULL)
Expand Down
3 changes: 2 additions & 1 deletion lmdb/midl.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 2000-2015 The OpenLDAP Foundation.
* Copyright 2000-2021 The OpenLDAP Foundation.
* Portions Copyright 2001-2021 Howard Chu, Symas Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
5 changes: 4 additions & 1 deletion lmdb/midl.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 2000-2015 The OpenLDAP Foundation.
* Copyright 2000-2021 The OpenLDAP Foundation.
* Portions Copyright 2001-2021 Howard Chu, Symas Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -55,7 +56,9 @@ typedef MDB_ID *MDB_IDL;
/* IDL sizes - likely should be even bigger
* limiting factors: sizeof(ID), thread stack size
*/
#ifndef MDB_IDL_LOGN
#define MDB_IDL_LOGN 16 /* DB_SIZE is 2^16, UM_SIZE is 2^17 */
#endif
#define MDB_IDL_DB_SIZE (1<<MDB_IDL_LOGN)
#define MDB_IDL_UM_SIZE (1<<(MDB_IDL_LOGN+1))

Expand Down
2 changes: 2 additions & 0 deletions update-lmdb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ echo "Temp dir: $tmp_dir"
curl -L "https://git.openldap.org/openldap/openldap/-/archive/LMDB_${version}/openldap-LMDB_${version}.tar.gz" | tar -C "$tmp_dir" -xvz
cp "$tmp_dir/openldap-LMDB_${version}/libraries/liblmdb/mdb.c" lmdb/mdb.c
cp "$tmp_dir/openldap-LMDB_${version}/libraries/liblmdb/lmdb.h" lmdb/lmdb.h
cp "$tmp_dir/openldap-LMDB_${version}/libraries/liblmdb/midl.c" lmdb/midl.c
cp "$tmp_dir/openldap-LMDB_${version}/libraries/liblmdb/midl.h" lmdb/midl.h
cp "$tmp_dir/openldap-LMDB_${version}/libraries/liblmdb/CHANGES" CHANGES.lmdb.txt

if [ ! -z "$tmp_dir" ]; then
Expand Down
Loading