Commit graph

955 commits

Author SHA1 Message Date
Howard Chu
425525fbec ITS#9224 lmdb: add support for PREPARE/2-phase commit 2026-02-03 16:48:47 +00:00
Ali Caglayan
be217bf254 ITS#10420 LMDB: add support for Haiku 2026-01-13 16:50:48 +00:00
Ali Caglayan
22206c0f5f ITS#10419 LMDB: add support for NetBSD 2026-01-13 16:50:45 +00:00
Howard Chu
7b136c42f1 ITS#10421 mdb_load: check for malicious input 2026-01-06 20:53:01 +00:00
Howard Chu
8ba07ad711 ITS#8988 lmdb: make all keys and data 2-byte aligned
This is an incompatible DB format change. Previously, only a single
pad byte was used if key+data was an odd size. Now, separate padding
is used for both odd keys and odd data sizes.

Note: also compile with -DMISALIGNED_OK=0 on x86 to avoid all
misaligned pgno accesses.
2025-12-16 17:33:38 +00:00
Kris Zyp
b961aca867 ITS#9564 lmdb: fix race condition freeing spilled pages at end of transaction
Move the freeing of the spilled pages list inside the protection of the
transaction mutex so there is no race condition with another transaction
2025-10-15 18:03:32 +01:00
Howard Chu
d12c97e275 ITS#10396 lmdb: fix mdb_cursor_del0 with multiple DUPSORT cursors
Use the correct stack index when adjusting other cursors pointing to
the affected page and the DB has a subDB. Broken in ITS#8406.
2025-10-06 16:52:11 +01:00
Howard Chu
9e8ee07dda ITS#10355 lmdb mplay: don't assign to stdin/stdout 2025-06-12 15:16:43 +01:00
Mike Moritz
b4aeb8cfd5 ITS#10346 lmdb: fix compacting copy with large values 2025-06-10 20:56:20 +01:00
jinyaoguo
2b77f6ffc2 ITS#10342 lmdb: fix potential memleak in child txn_begin 2025-06-10 20:41:32 +01:00
Howard Chu
71fe835056 More for rawpart
It was ignoring the mapsize recorded in the meta page, and was
redundantly mapping the meta pages.
2025-04-07 16:46:52 +01:00
Howard Chu
b6c4293f6f ITS#10024 lmdb: fix MDB_PREVSNAPSHOT txnid initialization 2025-02-21 04:42:03 +00:00
Howard Chu
9ec98ca00e ITS#10296 lmdb: fix typo in prev commit 2025-02-19 09:14:26 +00:00
kero
fc757af206 ITS#10296 lmdb: fix fdatasync on MacOS
Patch from kero, with corrections by hyc
2025-01-28 17:24:07 +00:00
Gary Wicker
63091b38e4 ITS#10275 mdb_load: add -Q option to use NOSYNC for faster loading 2024-10-26 21:25:48 +01:00
Howard Chu
defcb167fb Keep module code in a separate object file
That way programs that don't use these functions won't needlessly
depend on -ldl
2024-10-16 23:29:05 +01:00
Howard Chu
25635d8251 Cleanup redundant include 2024-10-16 23:11:20 +01:00
Howard Chu
b3fc03bae6 Delete unused module code 2024-10-16 22:50:06 +01:00
Howard Chu
14c7ff3347 Move the crypto module helpers into main liblmdb.
Just makes things easier than using the individual mdb_env_set APIs.
2024-10-16 22:47:42 +01:00
Howard Chu
1e7891c016 ITS#9920 lmdb: fix page offset when converting subpage to real page
offset needs to account for additional space at page tail
2024-10-16 17:36:18 +01:00
Howard Chu
c277aed15a ITS#9920 lmdb: fix data races in rpage decryption 2024-10-14 19:40:26 +01:00
Howard Chu
e895f5fd36 ITS#9920 crypto: use libsodium instead of OpenSSL
Note: even though the same algorithms were used, the data produced by
this module doesn't work with the OpenSSL-based module and vice versa.
2024-10-14 19:39:32 +01:00
Howard Chu
49726aa38b Another fix for OpenSSL 3.0+
Should rewrite this module to use libsodium instead.
2024-09-25 20:05:15 +01:00
Howard Chu
acab3df034 LMDB: Add a separate mlm_setup0() to separate loading from setup 2024-09-25 18:23:31 +01:00
Howard Chu
6cbb42aae0 ITS#9920 lmdb: cleanup prev commit 2024-09-17 00:11:22 +01:00
Howard Chu
d61005822c ITS#9920 lmdb: fix page_split of encrypted page 2024-09-16 21:11:08 +01:00
Andras
fd3c2adae7 ITS#10244 win32: Fix passed ptr type
From dfb3bbed65 ITS#9017
2024-07-30 14:28:54 +01:00
Howard Chu
ce6f8e2d93 ITS#9378 don't try to print oversized keys in debug msg 2024-06-17 17:06:19 +01:00
Howard Chu
c883e8f712 LMDB: tweak mdb_load.1 manpage
Add missing -a option to Synopsis
2024-06-03 21:17:19 +01:00
Zach Vonler
87dd0740e6 ITS#10222 LMDB: Updated mdb_dump man page
The -a option to mdb_load makes the previous text obsolete.
2024-06-03 21:17:13 +01:00
Howard Chu
a6e8631ef9 ITS#10212 LMDB: better fix 2024-05-03 20:44:38 +01:00
Howard Chu
4a25e0699b ITS#10212 LMDB: init txnid for read-only DBs 2024-05-02 16:33:22 +01:00
Howard Chu
dd2ad2fd5a ITS#10198 Win32 mdb_strerror - stop passing "ignored" parameter
The M$ docs say the parameter is ignored, but it actually isn't,
and will cause a SEGV if the pointed memory isn't an init'd va_list.
2024-04-04 07:17:23 +01:00
Howard Chu
0f8ee264c8 ITS#9037 mdb_page_search: fix error code when DBI record is missing
Use the more relevant MDB_BAD_DBI instead of MDB_NOTFOUND error code
2024-03-26 14:52:20 +00:00
Howard Chu
009dd91686 ITS#9378 Add replay tool
Reads a replay log and executes all the write ops
2024-01-09 17:42:58 +00:00
Howard Chu
9d45a80bf0 ITS#9378 Add explicit replay logging
Logs essential ops so they can be replayed.
Ignores read ops for now.
2024-01-09 17:19:36 +00:00
Howard Chu
b36e177c5a More crypto fixups 2023-12-26 01:43:42 +00:00
Howard Chu
ab27be5f93 crypto demo: fixup OpenSSL 3 compat 2023-12-25 23:33:43 +00:00
Clément Renault
22a41169c1 ITS#10137 LMDB: Allow users to define MDB_IDL_LOGN 2023-11-27 16:25:15 +00:00
Howard Chu
741970078d ITS#10125 mdb_load: fix cursor reinit in Append mode 2023-11-05 17:34:03 +00:00
Howard Chu
406311ae59 ITS#10095 partial revert of ITS#9278 2fd44e3251
The patch was incorrect and introduced numerous race conditions.
The original problem was a FreeBSD bug, subsequently fixed:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=269277
2023-08-27 15:50:51 +01:00
Howard Chu
6264f53975 ITS#9961 LMDB: fix MSVC error 2022-12-15 09:38:23 +00:00
Howard Chu
b9db2582cb ITS#9920 must account for size of authentication data
When computing amount of free space or fill factor in a page
2022-11-28 23:56:43 +00:00
Howard Chu
8e3cab0f63 ITS#9916 liblmdb: use alternate MDB_page2 struct for some accesses
fakepage pointers are only guaranteed to be 2-byte aligned. Use a
2-byte aligned struct definition when referencing 2-byte page members
if a page pointer possibly points to a fakepage.
2022-11-28 23:37:12 +00:00
Howard Chu
4031bdba88 ITS#9806 LMDB page_split: key threshold depends on page size
32 was chosen for page size of 4KB. Not large nough for 16KB pages.
2022-11-28 14:33:06 +00:00
Mike Hommey
405ca7106b ITS#9919 - Mark infrequently used functions as cold rather than manually putting them in a separate section 2022-09-27 17:29:46 +01:00
Mike Hommey
17e13f7c07 ITS#9030 - Use sys/cachectl.h rather than asm/cachectl.h on mips
It also contains the cacheflush function declaration.
2022-09-23 02:38:14 +01:00
Howard Chu
e51e6b8229 ITS#9910 fix typo
in ad3f8367b0
2022-09-21 20:18:34 +01:00
Howard Chu
97e7e9ac79 ITS#9524 fix loose page tracking
Fixes commit 0e17ba43a8, loose pages
that have been dropped from dirty list should no longer be counted.
2022-09-21 17:07:36 +01:00
NikoPLP
ad3f8367b0 ITS#9910 fix undefined MDB_FDATASYNC on MacOSX
Broken by d85fe32 ITS#9372
2022-09-01 17:41:50 +01:00