Leonid Yuriev
a4df0acb00
mdbx: more logging for FD < STDERR_FILENO
.
...
More for https://github.com/erthink/libmdbx/issues/144
Change-Id: I8dcd3cab8a39b16a1836c88ec92b30d6b0de8b51
2020-12-06 14:35:38 +03:00
Leonid Yuriev
c4944a58d5
mdbx: avoid spelling errors (cosmetics).
...
Change-Id: Ibf14e003ba740ba757b5403e92fd220e68930ce4
2020-12-05 22:51:45 +03:00
Leonid Yuriev
d116e7235a
mdbx-posix: safeguard for DB corruption in case FD <= STDERR_FILENO
.
...
Resolve https://github.com/erthink/libmdbx/issues/144
Change-Id: Ic3467338d494b021fa0d1863c8227976d0a2bcd5
2020-12-05 22:51:45 +03:00
Leonid Yuriev
3e7459b428
mdbx-windows: fix mdbx_realloc()
for nullptr and MDBX_AVOID_CRT=ON
.
...
Change-Id: I129221186d65254da5b1d84747e5c59d53864b70
2020-12-05 09:45:03 +03:00
Leonid Yuriev
338de2e1fb
mdbx: refine mdbx_page_spill()
.
...
More for https://github.com/erthink/libmdbx/issues/132 .
Change-Id: I40788c13b54453c17d5e5dae6c3d2f93226f8e00
2020-12-04 15:38:26 +03:00
Leonid Yuriev
12ee5e6cac
mdbx: minor refine mdbx_page_flush()
.
...
More for https://github.com/erthink/libmdbx/issues/132 .
Change-Id: I703e1359d859b8901fcbdf57211f7805cd6d5ff1
2020-12-04 15:38:26 +03:00
Leonid Yuriev
262e4981db
mdbx: refactor mdbx_pages_xkeep()
.
...
More for https://github.com/erthink/libmdbx/issues/132 .
Change-Id: Ie81b5c9efafa06e61d6d983769ff1f11a0e59a1e
2020-12-04 15:38:15 +03:00
Leonid Yuriev
df8260e29a
mdbx: add mdbx_pnl_purge_odd()
.
...
More for https://github.com/erthink/libmdbx/issues/132 .
Change-Id: I1926ee48785f30b82e827a8e1e69be1e7a0a209f
2020-12-04 15:38:15 +03:00
Leonid Yuriev
87c765c7be
mdbx: fix/check lower border for dirty-pages list's limits/options.
...
More for https://github.com/erthink/libmdbx/issues/128 .
Change-Id: Ie9dccee5cf90d26968db04f4f6d9afa3018fcf0e
2020-12-04 15:38:15 +03:00
Leonid Yuriev
0b02e080c4
mdbx: use pnl_xmerge()
to merge spill-pages lists.
...
More for https://github.com/erthink/libmdbx/issues/132 .
Change-Id: I1f84a2be1fa5da6cf0e2783ff56f7a4c20782a7f
2020-12-04 15:38:15 +03:00
Leonid Yuriev
d9bd306da3
mdbx-load: add -p
option (purge subDB).
...
Change-Id: I678950c99c8b4aea1add4ce548c9b4fe4ab8bfe6
2020-12-03 21:52:22 +03:00
Leonid Yuriev
90309ec0bf
mdbx: merge branch 'master' into devel.
...
Change-Id: Ib1d07cf6eb2e4c76b3be969b28bf2317cb326835
2020-12-03 18:42:10 +03:00
Leonid Yuriev
eb31b765a5
mdbx-tools: use MDBX_SAFE_NOSYNC | MDBX_ACCEDE
inside mdbx_load
.
...
Change-Id: Id5a3a447d6b80b96a97ec76c258825583546d791
2020-12-03 17:58:21 +03:00
Leonid Yuriev
76716c23b0
mdbx: add MDBX_opt_txn_dp_initial
& MDBX_opt_txn_dp_limit
.
...
More for https://github.com/erthink/libmdbx/issues/128
Change-Id: I4be3c7476e9ce16ed4f27691d0df653552930e3c
2020-12-03 17:17:30 +03:00
Leonid Yuriev
84235c7903
mdbx: drop unnecessary MDBX_HUGE_TRANSACTIONS
option.
...
Change-Id: I86116c2bada268d6e0a5c97deff808aaffe3e599
2020-12-03 17:17:28 +03:00
Leonid Yuriev
c5061f9289
mdbx: dynamic dirty-page-list size.
...
Resolve https://github.com/erthink/libmdbx/issues/123
Change-Id: I5d9b2d8c2259132617fd2b226b9d9a6790fcad88
2020-12-03 17:17:07 +03:00
Leonid Yuriev
6a5cec1f87
mdbx: refine mdbx_dpl_search()
.
...
Change-Id: I8acc87d9c2f306c981ad42cc859d32b7cfd7330e
2020-12-03 10:25:36 +03:00
Leonid Yuriev
d8d89cca7d
mdbx: refactor dirty-page-list (preparation to rework).
...
Change-Id: Ib52bb52f73ef1d31f55838d879de081fc0a140c2
2020-12-03 10:25:36 +03:00
Leonid Yuriev
7210f994fb
mdbx-windows: fix mdbx_realloc()
for nullptr and MDBX_AVOID_CRT=ON
.
...
Change-Id: I129221186d65254da5b1d84747e5c59d53864b70
2020-12-03 10:25:24 +03:00
Leonid Yuriev
a987301204
mdbx++: refine abort/commit.
...
More for https://github.com/erthink/libmdbx/pull/143
Change-Id: I07de4c43d039f904495f0f4caf586d8764174dcf
2020-12-03 09:32:25 +03:00
sasgas
5c693ccd96
mdbx++: fix missing null assignment.
...
Resolves https://github.com/erthink/libmdbx/pull/143
Change-Id: Ifb88cebe2f07297a2f6cf70e31ae6abe61a0c0b2
2020-12-03 09:17:36 +03:00
Leonid Yuriev
5636dbf12b
mdbx: add mdbx_dpl_alloc()
& mdbx_dpl_free()
.
...
Change-Id: I0f05ff02d4a45d02faa1076cbb1a2a8e17b7e2b9
2020-12-02 20:07:59 +03:00
Leonid Yuriev
c530c83337
mdbx: drop me_dirtylist
field.
...
Change-Id: I93ee802c1b6ef5c6a2443e19754e1a20dbe0aea9
2020-12-02 20:07:59 +03:00
Leonid Yuriev
0b62453f6d
mdbx: introduce MDBX_PGL_LIMIT
.
...
Change-Id: Ifab1156ec22fb0908284298393f52c09c0731829
2020-12-02 20:07:59 +03:00
Leonid Yuriev
4cd08f0ef9
mdbx: add MDBX_opt_rp_augment_limit
.
...
More for https://github.com/erthink/libmdbx/issues/128
Change-Id: I94f3350b72ad11d0b586aaef1574f7654223bc40
2020-12-02 20:07:55 +03:00
Leonid Yuriev
461ba000e3
mdbx: add MDBX_opt_dp_reserve_limit
.
...
More for https://github.com/erthink/libmdbx/issues/128
Change-Id: I620b6dcd833fcff19680770974f32431ab91c0ab
2020-12-02 12:42:16 +03:00
Leonid Yuriev
42019e0b8d
mdbx: add dp_reserve_limit
with 1024 default.
...
More for More for https://github.com/erthink/libmdbx/issues/128
Change-Id: Ia92b1aea58640f183202495e3f6e2d531057afd2
2020-12-02 12:42:16 +03:00
Leonid Yuriev
8f60050991
mdbx: initial support for set/get_options.
...
Initial for https://github.com/erthink/libmdbx/issues/128
Change-Id: I540784c8b54d7443748e3c95f89a7390b818c811
2020-12-02 12:42:13 +03:00
Leonid Yuriev
a8ed534cd3
mdbx: avoid 4-byte aligned (i.e. unaligned) access to 64-bit integers.
...
Historically, the page header provides 4-byte data alignment.
Therefore, unfortunately, the meta page data is also aligned on a 4-byte boundary, but contains 64-bit values.
This commit eliminates potentially unsafe access (SPARC, MIPS, etc) to these 64-bit values aligned on a 4-byte boundary.
Thus, a build with the `-fsanitize=undefined` now passes the tests both with CLANG 11 and GCC 10.
Change-Id: Ie441103e53ed96fd40507d8c0be0689e3fee69f5
2020-12-01 20:23:23 +03:00
Leonid Yuriev
adcb052915
mdbx: fix minor MSVC warnings.
2020-11-29 06:04:55 +03:00
Leonid Yuriev
2dab009e76
mdbx-windows: handling EXCEPTION_POSSIBLE_DEADLOCK
.
...
Change-Id: If42c7833e9c4e02fef25634e69c0bd2e926686c1
2020-11-29 05:49:15 +03:00
Leonid Yuriev
6d2914c99b
mdbx: minor/insignificant fix checking mdbx_rdt_lock()
result for cases mutex-recovery after EOWNERDEAD
.
...
Change-Id: Ia5e13ea0d72afc97f7d678832a765a192dfacdff
2020-11-25 17:55:29 +03:00
Leonid Yuriev
2a740d3807
mdbx-windows: fix ERROR_NOT_SUPPORTED
while opening UNC pathnames.
...
Resolve https://github.com/miranda-ng/miranda-ng/issues/2627
Change-Id: Iec06554dfcb9e0db215662d93fb5824cfe9ac7ef
2020-11-24 15:53:14 +03:00
Leonid Yuriev
23fd4444b5
mdbx-windows: remap whole section for mmap-resize if NtExtendSection()
not available (Wine).
...
Some workaround for https://github.com/miranda-ng/miranda-ng/issues/1209
Change-Id: I8ce3cb0fb8bdc9bd36a05ab53343efbe4080d1f3
2020-11-23 10:47:07 +03:00
Leonid Yuriev
ddee04d991
mdbx: set DXB/LCK files position outside of a data.
...
Set the position in files outside of the data to avoid corruption
due to erroneous use of file descriptors in the application code.
Change-Id: I8750f6e726edaddee254885756d5f91576a6bcb1
2020-11-23 09:25:24 +03:00
Leonid Yuriev
f76bf72021
mdbx-windows: retry resize-mmap always with reservation (less chance to failure).
...
Change-Id: I472651f6906b88ba674868e0cd6c81318bfc255b
2020-11-20 11:52:44 +03:00
Leonid Yuriev
537e3d18ae
mdbx: minor clarify mmap-resize logging.
...
Change-Id: Ibb6e4b8ee84d03a22ad0e0d1b437989739d43bb9
2020-11-20 10:38:04 +03:00
Leonid Yuriev
1bbf20bf39
mdbx: refine multi-thread flipping of buffers during env-copy.
...
Change-Id: Id132c1af0e1131da70ab1b35bce9f6a6548edbe3
2020-11-19 11:59:42 +03:00
Leonid Yuriev
9054b25441
mdbx: fix fast completion of nested txn for case ones was open present DBIs.
...
Change-Id: I87d28d1da5f72cc7ad77f8dd3f9a181f7eaa0024
2020-11-19 09:26:33 +03:00
Leonid Yuriev
862cfb9a3b
mdbx-windows: refine WSL1 detection.
...
Try to fix https://github.com/snej/nimdbx/issues/1
Change-Id: Iec1c77c82ced8095e3f4e03a27a58e0bba3df76b
2020-11-18 22:38:26 +03:00
Leonid Yuriev
26767a5e06
mdbx: relax big-page size checking for compatibility.
...
i.e. allow an overflow page be larger than required by placed data.
2020-11-18 03:42:05 +03:00
Leonid Yuriev
96c2a56aa1
mdbx: use MDBX_SET_LOWERBOUND
in mdbx_get_equal_or_great()
.
...
Change-Id: I5dd72fe82bd15938afc60cbc0f92e23c00f0d344
2020-11-17 08:13:46 +03:00
Leonid Yuriev
5e02e7fb56
mdbx: add MDBX_SET_LOWERBOUND
for mdbx_cursor_get()
.
...
Change-Id: I3638fdd10be8dfe128c43b465e9ca71f89175b3e
2020-11-17 08:13:46 +03:00
Leonid Yuriev
9ea6922a2f
mdbx: minor simplify mdbx_cursor_set()
.
...
Change-Id: I034f396368024af21e8ee741c13a28c9bc277121
2020-11-17 07:59:51 +03:00
Leonid Yuriev
56a52b0b01
mdbx: merge branch 'fix-131' (early part) into devel.
...
Change-Id: I0df5ffa9f06da1196a60d5a7c68fed59b7027e4c
2020-11-16 07:07:53 +03:00
Leonid Yuriev
149b3d09e6
mdbx: don't export DBIs from nested txn.
...
Change-Id: I8c354ac7f889debe2fcf830263cb060253887652
2020-11-16 07:07:39 +03:00
Leonid Yuriev
1c925a0f2e
mdbx: minor fix/avoid assertion inside mdbx_cursor_set()
.
...
Change-Id: I2cc38da698765b3eaa2bb575e16505d5d9438431
2020-11-16 07:07:39 +03:00
Leonid Yuriev
0c3deac9db
mdbx: fix cursors-EOF after search.
...
Change-Id: Ie578611b64cca8dbcc00f958510143e8d1dc262a
2020-11-16 07:07:39 +03:00
Leonid Yuriev
21bbba82fb
mdbx: minor fix cursor_on_first/last for empty sub-db.
...
Change-Id: I68c2e1bd28e62c9512bf8ef711fe21573e3450b9
2020-11-16 07:07:39 +03:00
Leonid Yuriev
4ea2bea22e
mdbx: fix save/restore/commit cursors for nested txn.
...
Change-Id: Ibaf356bbc631ca2e41058787bd3e4aaaa8bc085a
2020-11-16 07:07:38 +03:00
Leonid Yuriev
e328c1f829
mdbx: refactor/move mdbx_cursor_count()
.
...
Change-Id: I5487342013dfc3a9cf12d9081471ace0c37de23d
2020-11-16 07:07:38 +03:00
Leonid Yuriev
ca115dd6a4
mdbx: refactor/rename/refine tw.cursors
internals.
...
Change-Id: Ie46d15f52a9d7365b52534a630754a31d3005a69
2020-11-16 07:07:38 +03:00
Leonid Yuriev
9a2dbb845c
mdbx: refactor/refine cursor next/prev.
...
Change-Id: I0bfe0fed62e137e933027ba90cec23dbf1a6310b
2020-11-16 07:07:38 +03:00
Leonid Yuriev
5f09ec73c9
mdbx: return MDBX_ENODATA
instead of MDBX_EINVAL
for non-positioned/EOF cursor and MDBX_GET_CURRENT
.
...
Change-Id: I2adf76f8f662e77e5a6aa077344fab6b430975c4
2020-11-16 07:07:38 +03:00
Leonid Yuriev
c55f99073b
mdbx: fix MDBX_NEXT
for EOF case.
...
Change-Id: I84c033a24d2215a4867affab5b148bf6ba5d57dc
2020-11-16 07:07:38 +03:00
Leonid Yuriev
b1446b7752
mdbx: minor fix/distinction MDBX_EBADSIGN
and MDBX_EINVAL
errors for cursors.
...
Change-Id: I6d72638a69ff0f793156fe5e0e7ca5531a97c7cf
2020-11-16 07:07:38 +03:00
Leonid Yuriev
b6f0070f85
mdbx: add mdbx_cursor_copy()
.
...
Change-Id: I476f1230beec6a550897bef236745530154c1079
2020-11-16 07:07:38 +03:00
Leonid Yuriev
2489e0ba6e
mdbx: refactor/rename cursor_copy_internal()
.
...
Change-Id: I334e68d3d424ef15cafcaafd23d61f80611fce01
2020-11-16 07:07:38 +03:00
Leonid Yuriev
459e769844
mdbx: engage cursor tracking for all merge/rebalance operations.
...
Assume this resolves https://github.com/erthink/libmdbx/issues/131 .
Change-Id: I5111618a34d91d083b81245ac959b744a86c4495
2020-11-16 07:07:27 +03:00
Leonid Yuriev
37a1d546b7
mdbx: minor refine mdbx_rebalance()
.
...
Change-Id: I10a6a208b173bdee1d325aa7b2624de879814647
2020-11-16 06:28:11 +03:00
Leonid Yuriev
b209e91ad4
mdbx: zeroed mc_top
while tracking nested cursors.
...
This avoids scanning dummy cursors during tracking.
Change-Id: Id4edc665010215b4a946f9438475691f1387313c
2020-11-16 05:48:44 +03:00
Leonid Yuriev
0c78da99b0
mdbx: add cursor_is_tracked()
and assertions.
...
Change-Id: I83db1a714597b134aa30e4ca7019bb7f541a2428
2020-11-16 05:48:23 +03:00
Leonid Yuriev
10681a53ae
mdbx: cleanup/refine GC-flags inside mdbx_page_alloc()
.
...
Change-Id: Ie81c703815a7b3fbe59ad9b406811d5ed2913d02
2020-11-16 05:43:53 +03:00
Leonid Yuriev
06691aeafc
mdbx-load: fix/preserve DB geometry without the mapsize
header item.
...
More for https://github.com/erthink/libmdbx/issues/136 .
Change-Id: I385869f2894ebe83b00b4e5b7ac4cacaabaf25d9
2020-11-16 00:53:34 +03:00
Leonid Yuriev
462df477b0
mdbx-load: cosmetic fix missed space.
...
Change-Id: Ifb9deb7c31d2d191b621280b6afd63fad9d436a3
2020-11-15 07:57:46 +03:00
Leonid Yuriev
74e495569e
mdbx-load: fix DBI-error without -s name
option.
...
Related to https://github.com/erthink/libmdbx/issues/136
Change-Id: I1e634456867f92dc1488a826eabf65ab28e64c1b
2020-11-15 07:57:15 +03:00
Leonid Yuriev
3ed58c281a
mdbx-load: fix hang at EOF in the 'plain text' (i.e. no headers) mode.
...
Related to https://github.com/erthink/libmdbx/issues/136
Change-Id: I6ac9762bc5ac6aaf8b947b2e4abb0b4ff6a14444
2020-11-15 07:54:09 +03:00
Leonid Yuriev
21d2af9e90
mdbx: merge branch 'c++' into devel.
...
Change-Id: Ibd7f6c323aaf4f681a2c2dd442d36f4a9459d400
2020-11-01 00:39:19 +03:00
Leonid Yuriev
4cb8067dce
mdbx++: always provide implementation for mdbx::path == std::string
.
...
Change-Id: I8ef5c1531dc378b4141637ec4ddae3bbc67f1570
2020-10-31 23:24:05 +03:00
Leonid Yuriev
586e25c48c
mdbx++: add operator<<(ostream, pair_result)
.
...
Change-Id: I44cc28f7f4f7d65225239d62f5bb8a15a8de16a8
2020-10-31 23:23:46 +03:00
Leonid Yuriev
e3f32ec6b4
mdbx++: refine operator<<(ostream, pair)
.
...
Change-Id: I0f42c17a241cf4e2ed6ae8f18e84a13ba5500a3b
2020-10-31 23:23:30 +03:00
Leonid Yuriev
4e198915f2
mdbx++: fix slice::is_printable()
.
...
Change-Id: I7f572f8e2179313e3cd312a58e46d445b920ba3e
2020-10-31 23:22:31 +03:00
Leonid Yuriev
5ad167410c
mdbx: fix handling MDBX_GET_BOTH_RANGE
.
...
Partially revert 77e84ccca8d634db087fc710b1c4aea69ee5a6a6 and 7522246ccdb3c1b0928aa3e0f593133db0fadae5.
Resolves https://github.com/erthink/libmdbx/issues/130
Change-Id: Ib9f49a3e6a108a0d914ccde7ccb4dc0ef6056ff7
2020-10-31 20:54:53 +03:00
Leonid Yuriev
70241e25db
mdbx: don't limit reclaimed-pglist if DB full.
...
More for 55d190bad9723fd9766466005b1a14e70779fc89 and https://github.com/erthink/libmdbx/issues/123
Change-Id: Iecd19fe8f159d29a1434d03f43f0b277f2d6ab86
2020-10-30 19:22:37 +03:00
Leonid Yuriev
d9ceb84445
mdbx-tools: use mdbx_cursor_bind()
inside the mdbx_load
.
...
Change-Id: I632841817331dfd493125c95350ec79e26147171
2020-10-30 17:44:51 +03:00
Leonid Yuriev
0f64d0ee95
mdbx: update internal MDBX_NO_ROOT
.
2020-10-30 17:44:51 +03:00
Leonid Yuriev
d5658c496f
mdbx: fix mp_txnid
check for spilled pages.
...
This is OMG stupid bug.
Тем не менее, ошибка не была замечена по трём причинам:
- some TODOs should be resolved, like [this](faddc71eac/src/core.c (4014)
) and some others;
- test cases should be extended to triggering the page spilling threshold;
- mdbx_env_set_option() should be provide to tunning such threshold(s) (https://github.com/erthink/libmdbx/issues/128 ).
Resolves https://github.com/erthink/libmdbx/issues/126
Change-Id: If76336620aa83e6916e3aeaa838e0b6e68c34fd7
2020-10-30 17:44:31 +03:00
Leonid Yuriev
16c900b0a1
mdbx: fix assertion inside mdbx_cursor_del0()
.
...
Change-Id: I87ad3777215bee8a2b19f53ec92299db89431fa4
2020-10-29 00:55:42 +03:00
Leonid Yuriev
105947b50c
mdbx: minor refine internals comments/docs.
...
Change-Id: Ie1dd2233259948b4906e66fb191832dbc6526c47
2020-10-29 00:55:12 +03:00
Leonid Yuriev
faddc71eac
mdbx-tools: cleanup/refine mdbx_dump
& mdbx_load
.
2020-10-27 01:08:01 +03:00
Leonid Yuriev
3fd079262c
mdbx: fix extra-rare MDBX_KEY_EXIST
during mdbx_commit()
.
...
The MDX_KEYEXISTS error could occur inside mdbx_update_gc() in the extremely rare case:
- no GC records was reclaimed before mdbx_txn_commit() called;
- there were few loose pages during the transaction;
- some reader prohibit reclaiming, therefore mdbx_page_alloc(MDBX_ALLOC_GC),
which called for obtain present GC-record's Id, returns MDBX_NOTFOUND;
- immediately then the reader completes its transaction and unlocks reclaiming;
- mdbx_update_gc() decide that no reclaimable GC entries,
i.e. no GC-entries with ID < find_oldest(),
and it is safe to use find_oldest() - 1 to store loose page list;
- but find_oldest() actually returns new/larger ID than expected,
So KEYEXISTS will returned if using this ID.
Change-Id: I9726217d6b5983f1e31a211c0eeb3edc8ff94282
2020-10-26 14:37:16 +03:00
Leonid Yuriev
1804b78406
mdbx-debug: alter begin/end debug-includes.
...
Change-Id: I024e992f6864befa1a6cfbf2dd696c19095d3cdf
2020-10-26 14:36:59 +03:00
Leonid Yuriev
77e84ccca8
mdbx: refine mdbx_cursor_set()
around the exact-flag.
...
Change-Id: Ifbad6bb4a3a4eabaf85c7986f9566705d53c45b9
2020-10-26 03:52:07 +03:00
Leonid Yuriev
7522246ccd
mdbx: fix intenals for mdbx_get_equal_or_great()
.
...
Change-Id: I7b44df14c6f9ede4844d53e28c1b34d84fc664fa
2020-10-26 00:42:21 +03:00
Leonid Yuriev
005517539b
mdbx: adds SIGPIPE
suppression inside the env_copy-thread.
...
Change-Id: Ib7d22b8db7435b396bd997b65ae1d6d5d3431ba9
2020-10-23 03:22:22 +03:00
Leonid Yuriev
fed14c8f4c
mdbx: minor tweak mdbx_pages_xkeep()
.
...
Change-Id: I6df699aeb49640b0365918c33cff05dcbcef2b71
2020-10-23 03:18:00 +03:00
Leonid Yuriev
55d190bad9
mdbx: avoid MDBX_TXN_FULL
while searching for a large multi-page region.
...
Resolves https://github.com/erthink/libmdbx/issues/123
but with TODO:
- provide a user-configurable threshold instead of currently hard-coded default (MDBX_PNL_MAX/2).
Change-Id: Ia7bfd5f8d36e027444d234e3c3aabe4832313466
2020-10-22 18:04:02 +03:00
Leonid Yuriev
8a7caec54a
mdbx: cleanup deletion internals.
...
Change-Id: Ibcc5e02d5274c4eac5d6f269bc2b029f6b30c5ab
2020-10-22 16:28:44 +03:00
Leonid Yuriev
b0928219c3
mdbx: fast completion pure nested transactions.
...
Change-Id: I467cc0f2f3e781bf23bf8c45eb021987ae7c123b
2020-10-21 02:24:39 +03:00
Leonid Yuriev
daf37363b4
mdbx: fix cursor state after delete current entry.
...
The fix affect enough of code sections,
so there is a chance that some more changes will be required.
Resolves https://github.com/erthink/libmdbx/issues/121
Related to https://github.com/ledgerwatch/turbo-geth/issues/1147
Change-Id: I45b7637516de410923a0d723dbda8d818662ba15
2020-10-21 02:24:33 +03:00
Leonid Yuriev
b964b2abf5
mdbx: more spelling.
...
Change-Id: I45e42c1d8ef51f910b8e41279b92e54a6b2ce772
2020-10-21 01:00:48 +03:00
Leonid Yuriev
7001d971e1
mdbx: clarify/refine mdbx_flush_iov().
...
Change-Id: Ib9462efdbf97e42b1e80bf130f8150072102d9ed
2020-10-21 01:00:48 +03:00
Leonid Yuriev
f73a8a8680
mdbx: add latency gathering for commit stages.
...
Change-Id: If68ceb6e69e5e565ce9de0fd9a80424b6da280c5
2020-10-21 01:00:48 +03:00
Leonid Yuriev
7cf92b66cf
mdbx: add LIBMDBX_INLINE_API (both inline and non-inline of some API functions).
...
Change-Id: I00c2b6d3d2a0467080791ea0c1c2242742a20c78
2020-10-17 01:00:36 +03:00
Leonid Yuriev
38485c9f30
mdbx: minor refine cursor_sibling()
.
...
Change-Id: I2c92ef2c3081dfa0a9bdcd47de0f912a9927519e
2020-10-16 18:57:07 +03:00
Leonid Yuriev
112ce742f5
mdbx: refine update_gc()
.
...
Change-Id: I877cdf2efb623c61dc810ec1cebb985fe925a120
2020-10-12 00:09:06 +03:00
Leonid Yuriev
62da4db09a
mdbx: fix/refine the use of C11 atomics.
...
Change-Id: I5d925d4625b06296fd82f4b35ee36be682e7b2d3
2020-10-11 18:54:07 +03:00
Leonid Yuriev
041a4c0aa5
mdbx: make enabling of read-ahead strategy more aggressive.
...
Change-Id: I7765c1a1ac27db86ce9676846ec5a723860dc934
2020-10-11 01:14:30 +03:00
Leonid Yuriev
071ad525c8
mdbx: refine handle_env_pathname()
for direct pathname of data-file inside sudir-mode.
...
Change-Id: I5b7e7c7ea5c17e00c344fedb5c96f8d94fc04fc8
2020-10-11 00:14:53 +03:00
Leonid Yuriev
1d71c677f6
mdbx++: add env::remove()
method.
...
Change-Id: If0396d38738df88d054eb8fb752c7bd3afbd8487
2020-10-10 18:31:15 +03:00
Leonid Yuriev
0627d902dd
mdbx: add mdbx_env_delete()
.
...
Resolves https://github.com/erthink/libmdbx/issues/119
Related to https://github.com/Kerollmops/heed/issues/58
Change-Id: Iec5bf5978e45bb6843f3ed8dd06ea4d34f2895cb
2020-10-10 00:58:53 +03:00
Leonid Yuriev
cd0c727880
mdbx: internally split-out mdbx_handle_env_pathname()
.
...
Change-Id: Ibe387662d737d4d1e274ac0e126053872be503f9
2020-10-10 00:52:41 +03:00
Leonid Yuriev
9bf7d53dc2
mdbx: MAX_MAPSIZE32
value has been reduced to 0x7f000000
.
...
Change-Id: Ia45dd56621cd92441a45b8e80420a124cd111fdc
2020-10-10 00:52:41 +03:00
Leonid Yuriev
7ba13d8e72
mdbx: add internal bits/flags table.
...
Change-Id: Ia9d0e9f678b51d8ffd1830998e9cd5d04c749974
2020-10-10 00:52:41 +03:00
Leonid Yuriev
c139eacb2d
mdbx-chk: avoid use GetTickCount64() for Windows 2000/XP.
...
Change-Id: Ibad5c5ec0590cd3776283237de2cb83126785726
2020-10-08 01:50:18 +03:00
Leonid Yuriev
9b64b95bbc
mdbx-windows: fix mdbx_RegGetValue() for Windows 2000/XP.
...
Change-Id: I436a254300fcba8dbf75ea7568c2bf0c963fe060
2020-10-08 01:50:18 +03:00
George Hazan
e8fecd1eec
mdbx: fix opening DB on a network shares (pass MDBX_EXCLUSIVE from env).
...
Change-Id: Ic5c68033ba81043ac7800f99aae364bf082c868f
2020-10-08 01:50:18 +03:00
Leonid Yuriev
0f3b82f661
mdbx: minor refine WITH_CURSOR_TRACKING macro.
...
Change-Id: I61a4782ae76aed624fe37f7dde2b0ef7eb5dfb64
2020-10-08 01:50:18 +03:00
Leonid Yuriev
b274fdd142
mdbx: clarify page-merge strategy.
...
Change-Id: I1bb843ab6bdfcd53deae6d219a5b164bd3a79fd3
2020-10-08 01:49:56 +03:00
Leonid Yuriev
f5ce471ebb
mdbx: fix minor copy&paste typo.
...
Change-Id: I5a1be230d0ca92123006e709aaaf78496918c91a
2020-10-07 12:18:28 +03:00
Leonid Yuriev
fe65c122d2
mdbx: fix pthread_yield()
for non-GLIBC.
...
Change-Id: I080e37a42b62e524896dea8747e9f23e2fcd584f
2020-10-06 00:28:12 +03:00
Leonid Yuriev
8d4e7994c0
mdbx-load: fix minor false-positive GCC warning.
...
Change-Id: Ie75c793712d050e8d3da76a4d0a8df9b81dc5275
2020-10-05 19:15:18 +03:00
Leonid Yuriev
70b615e8d4
mdbx: don't use yield
instruction on ARM if unsupported.
...
Change-Id: I0b01d783fe4336b089f4b051fb61c203b5879aa5
2020-10-05 19:15:07 +03:00
Leonid Yuriev
280ed17ea2
mdbx: fix obsolete __noreturn
.
...
Change-Id: Ic78843d6f16de2a409c16ceecc7acb2ed8aa3e68
2020-10-05 19:14:20 +03:00
Leonid Yuriev
fc965c57ac
mdbx: fix merge_sync_flags() to preserve MDBX_UTTERLY_NOSYNC.
...
Change-Id: I59dbd1ef8ac1747dd20565ff444e4feb5d0e0e71
2020-09-30 04:01:36 +03:00
Leonid Yuriev
f6850f5367
mdbx: Support for user-settable cursor context.
...
Change-Id: I9bd60c432924e39020b2d3af3280f13c44d6cd91
2020-09-29 21:15:25 +03:00
Leonid Yuriev
72e136b9da
mdbx-doc: fix/refine README & Doxygen docs.
...
Change-Id: I79cfb44f84fbf0f118b0d209af1ef62bb9dae72a
2020-09-29 21:15:25 +03:00
Leonid Yuriev
c8a0951566
mdbx: rework API and Docs around Handle-Slow-Readers (no algorithmic changes).
...
Change-Id: I5b76a8400ce6f5f241f8e4a7f53d746fe39f8e1e
2020-09-29 21:15:25 +03:00
Leonid Yuriev
6294e1710a
mdbx: support for user-settable transaction context.
...
Change-Id: Ib4a345628e2c1ca2f95ac7615ea53d94911e5198
2020-09-29 20:59:55 +03:00
Leonid Yuriev
10c50aaf2e
mdbx-cmake: minor refine MDBX_BUILD_TARGET/MDBX_BUILD_TYPE, etc.
...
Change-Id: I34f99c50ced56b310576743c56422a1e1992c03b
2020-09-29 20:59:55 +03:00
Leonid Yuriev
5374d06d92
mdbx: fix minor MSVC warning.
...
Change-Id: Ie3c9fa7ba21cd88f7a0c08a1529542ba394fe9c8
2020-09-29 20:59:55 +03:00
Leonid Yuriev
2a0c9d83e0
mdbx-load: refine usage-help for -n
option.
...
Change-Id: I4af2ea041bca323f8647601f49610f93a8f97d38
2020-09-28 15:48:21 +03:00
Leonid Yuriev
c0cc531b50
mdbx-doc: minor refine man-pages for -n
utils option.
...
Change-Id: Ie81145fc1ec70f66e6c7be7332b2106d6636dc6b
2020-09-28 15:48:21 +03:00
Leonid Yuriev
92bc728f39
mdbx: update warnings/errors for old version GCC/CLANG/MSVC/GLIBC.
...
Change-Id: I355316f6c8d96eae4bd5d9743f0b6e50caddcbcd
2020-09-27 17:01:59 +03:00
Leonid Yuriev
1e3f633665
mdbx: fix build with uclibc.
...
Change-Id: I907fecd84b335a84d5f1dcaa44ac489c4dfb1907
2020-09-27 17:01:59 +03:00
Leonid Yuriev
5627521f16
mdbx++: more spelling.
...
Change-Id: I3f33e695fb918c6a57c39047bba54a72ecb9bc5b
2020-09-27 17:01:59 +03:00
Leonid Yuriev
5d582b1b3a
mdbx-chk: refine output (bootid, steady/weak, kv-kind).
...
Change-Id: Ia2474f7bb9a25adf761a561d0704362dca930796
2020-09-27 17:01:58 +03:00
Leonid Yuriev
6eaa838e3e
mdbx: clarify logging for MDBX_WANNA_RECOVERY in case sync-needed in rdonly-mode.
...
Change-Id: I7032cfbce857e2acfb93de383272a4f41ab6a7fb
2020-09-27 17:01:58 +03:00
Leonid Yuriev
12339d4e7c
mdbx: rename bootid' fields to be neutral for endianess.
...
Change-Id: I7d52d3c2c93dcc6e886d336885070eb1aee1c284
2020-09-26 02:23:09 +03:00
Leonid Yuriev
12652852bd
mdbx-doc: update man-pages.
...
Change-Id: Ia9caf0082c32cf95526cc1080507c61f9269c9dc
2020-09-25 02:10:55 +03:00
Leonid Yuriev
af331a9e7c
mdbx-tools: fix getopt's messages for windows.
...
Thank to Andrey Sporaw for the reporting.
Change-Id: I7531427c48b1a2f5483e2f04175cded2d34062a8
2020-09-25 01:53:43 +03:00
Leonid Yuriev
75a4463811
mdbx: minor misc cosmetics & refines.
...
Change-Id: I84b70aeded047ab3786a57c864dbc89364969afa
2020-09-25 01:21:45 +03:00
Leonid Yuriev
860aa017db
mdbx: Merge branch 'master' into devel.
...
Change-Id: Ic130cd181097332aa2f49019d75403e18d8cba0d
2020-09-25 01:14:57 +03:00
Josh Soref
448728f584
mdbx: a lot of spelling (squashed).
...
Many Thanks to Josh Soref for these fixes.
https://github.com/jsoref
Resolves https://github.com/erthink/libmdbx/pull/118 .
Change-Id: I4e09347da5c9d7a77cdd918a3b15284371440076
2020-09-25 01:01:25 +03:00
Leonid Yuriev
4eab5b238a
mdbx-chk: support for turn to a specified meta-page.
...
Change-Id: I9d088681e7bd66a2f8b5917067c4f847733d17ac
2020-09-23 10:05:38 +03:00
Leonid Yuriev
58708f7162
mdbx: add mdbx_env_turn_for_recovery().
...
Change-Id: Ic02a5adf9ad398ae5b499e8808157e41ec42457e
2020-09-23 10:05:38 +03:00
Leonid Yuriev
9b5097fe9d
mdbx: add paranoid checks for txnid overflow.
...
Change-Id: I0036a080d40a0da9ffc55ff838d91799ff0ceadb
2020-09-23 10:05:38 +03:00
Leonid Yuriev
c67a611313
mdbx-chk: refine output basic info of sub-databases.
...
Change-Id: Ia51b753990eb7a552dab016aab352b37c62ce4c3
2020-09-23 10:05:37 +03:00
Leonid Yuriev
7762e6e836
mdbx-chk: show last modification of each sub-database.
...
Change-Id: Ib424d17371adaef543a10b4f1d8a456cd6466046
2020-09-23 10:05:37 +03:00
Leonid Yuriev
d4b16c981d
mdbx: fix minor Coverity warning.
...
Change-Id: Id92d85a7032a20a4b06d87878e32d8997b6558e3
2020-09-23 10:05:37 +03:00
Leonid Yuriev
45909eca61
mdbx-chk: fix minor typo.
...
Change-Id: Ib120f7af827463dd93af352fc8b4ce6af1926b75
2020-09-23 10:05:37 +03:00
Leonid Yuriev
7fe4fccda8
mdbx: acquire exclusive lock for the destination file during mdbx_env_copy().
...
Change-Id: Ic75796025dd2a649840b96b1f71aecac9360d010
2020-09-23 10:05:37 +03:00
Leonid Yuriev
24c0749eb8
mdbx: rework/refine mdbx_mresize() for POSIX and MAP_FIXED_NOREPLACE (Linux 4.17).
...
Change-Id: I2e531b5e3e009b2a18ae1901fc7e2e6e4df667cd
2020-09-22 04:07:43 +03:00
Leonid Yuriev
a7a8631bc3
mdbx: allow sync_file_range() to fail for Valgrind/QEMU cases.
...
Change-Id: I9aa77d1debfbd0cb18e940946533e4ed758d08e8
2020-09-21 17:18:07 +03:00
Leonid Yuriev
c01750be2e
mdbx: provide MDBX_USE_SYNCFILERANGE option.
...
Change-Id: Icf1f27d6203653b4e2f2180a59a65e958c4d5e2e
2020-09-21 17:18:07 +03:00
Leonid Yuriev
a2e2e5c8a0
mdbx: allow sendfile() and copy_file_range() to fail for Valgrind/QEMU cases.
...
Change-Id: I37ee8d652d91a8d2106c782beceaacb13e9f667f
2020-09-21 03:29:38 +03:00
Leonid Yuriev
25e3968199
mdbx: provide MDBX_USE_SENDFILE and MDBX_USE_SENDFILE options.
...
Change-Id: Icd9a6487ae6e398276a9e720926ff24de5897c1a
2020-09-20 20:16:26 +03:00
Leonid Yuriev
765a18ed59
mdbx_chk: support for checking using specified meta-page.
...
Change-Id: Iadb930154acb966f03aa1dec9cc7cbdc76779f05
2020-09-19 02:55:19 +03:00
Leonid Yuriev
d9daf2944d
mdbx: add env_open_for_recovery() (squashed).
...
Change-Id: I0151b21610def433745c33d1f6e0b66ce655d1a9
2020-09-19 01:48:24 +03:00
Leonid Yuriev
b321f67ed2
mdbx: Merge branch 'master' into devel.
...
Change-Id: I4f180753fe52b54f37f4fd12af2ba1b3ca541726
2020-09-19 01:47:12 +03:00
Leonid Yuriev
73647a5e46
mdbx: fix/refine mdbx_walk_tree() for working with invalid/corrupted DB.
...
Change-Id: I2594b785f675319027ff129d12683c4392e6e2f4
2020-09-19 01:44:21 +03:00
Leonid Yuriev
6a99303ec1
mdbx: fix mdbx_strerror() for MDBX_BUSY error.
...
Change-Id: Iea02f1daa3f52a9b737366e9af3c7def748ab523
2020-09-18 23:57:35 +03:00
Leonid Yuriev
e762442917
mdbx: don't resize mapping beyond used part of DB for read-only txn.
...
This allow reading extra large DB when used part is acceptable for current platform, i.e. reading DB >4G on a 32-bit platform.
2020-09-18 15:02:36 +03:00
Leonid Yuriev
488a272f8b
mdbx: more for opening large DB from 32-bit env.
...
- return `MDBX_TOO_LARGE` only when used part of DB is too large for current platform;
- auto lowering both of `mm_geo.lower` and `mm_geo.upper` if the used part of DB is acceptable for current platform;
Change-Id: If67109ebb96063451c50f279c473ed38355a098a
2020-09-18 13:34:34 +03:00
Burak Arslan
efe400264f
mdbx: minor fix msvc build ( #117 ).
2020-09-15 20:03:42 +03:00
Leonid Yuriev
10b170c6cd
mdbx: add mdbx_cursor_create() and mdbx_cursor_bind().
...
Change-Id: I223de3cca7865d58f17a59ab27ec6be730e04a90
2020-09-15 02:05:25 +03:00
Leonid Yuriev
234d65dc9d
mdbx++: update copyright & license note.
...
Change-Id: If6aac3dec6d05247aec5af956385066619685c35
2020-09-14 21:19:56 +03:00
Leonid Yuriev
cacc4aa829
mdbx++: changes after codereview-1 (part 2 of 2).
...
Change-Id: I8e1ca134bb8c5d447895f116247dfd12fa6871f0
2020-09-14 21:19:56 +03:00
Leonid Yuriev
04b0d258ff
mdbx++: changes after codereview-1 (part 1 of 2).
...
Change-Id: If58c4281ce29f95fd566bc615082963a9500c381
2020-09-14 17:18:20 +03:00
Leonid Yuriev
da151e52a7
mdbx++: hide/move trouble_location
to unused section.
...
Change-Id: If0cb1ae18e164819f916ff6fc1b5e6e487f50368
2020-09-14 02:23:19 +03:00
Leonid Yuriev
17d9ed31f9
mdbx: support for building by GCC 4.8
...
Change-Id: I4ad5c5be60233ae68936e0cbca1a0f01ec786bad
2020-09-13 21:22:41 +03:00
Leonid Yuriev
6c70a7fe11
mdbx++: enables C++ API for amalgamated source code.
...
Change-Id: Ie73f32ee6b9a565eee69fa7267798a0fd67db4b0
2020-09-13 21:22:41 +03:00
Leonid Yuriev
cd4caeb03d
mdbx: add mdbx_panic() to C API.
...
Change-Id: I009a7889311b57ae2210822a8087889f900919f8
2020-09-10 15:37:59 +03:00
Leonid Yuriev
58bcfb006e
mdbx: add mdbx_printf_args() macro.
...
Change-Id: I7fca72f8cc912d8644ecf149b755c78fb3cc7e23
2020-09-10 15:35:43 +03:00
Leonid Yuriev
50c25f479d
mdbx++: more Doxygen descriptions and refinement.
...
Change-Id: Iec4cfa220f140c0fcc858f51283af2f9c4dd7a65
2020-09-10 01:15:35 +03:00
Leonid Yuriev
9249297d31
mdbx: fix MSVC compiler version requirements.
...
Change-Id: Iabf7ab571ca887bd7995ae6293d3c70bb85a947b
2020-09-07 12:38:08 +03:00
Leonid Yuriev
538d2e4d62
mdbx: skip update meta-geo in read-only mode.
...
Change-Id: I1c9610920ad87dc8110e8d03038ef385220000c8
2020-09-07 12:38:08 +03:00
Leonid Yuriev
81f82ae7b3
mdbx++: added partial doxygen descriptions and refined some methods.
...
Change-Id: I98bd4cb6e296970abbd40ffa049eff6051f30135
2020-09-07 03:10:25 +03:00
Leonid Yuriev
2bcd2e510e
mdbx: Merge branch 'devel' into c++.
...
Change-Id: Iedfe7e7ae21d08628c24b4dd5a788bc43cced2f5
2020-09-05 13:48:40 +03:00
Leonid Yuriev
ab9f47a5fe
mdbx: fix MSVC compiler version requirements.
...
Change-Id: Iabf7ab571ca887bd7995ae6293d3c70bb85a947b
2020-09-05 12:16:00 +03:00
Leonid Yuriev
54ccb92444
mdbx: skip update meta-geo in read-only mode.
...
Change-Id: I1c9610920ad87dc8110e8d03038ef385220000c8
2020-09-05 11:57:34 +03:00
Leonid Yuriev
c24e566591
mdbx: alter notice/warning/verbose level of some log-messages.
...
Change-Id: I08c3f5cf6489095f04c8becc4818d34b8db61422
2020-09-05 11:48:29 +03:00
Leonid Yuriev
6d7ec5a257
mdbx: enable non-debug logging in non-debug builds.
...
Change-Id: I295de5ef6369a55500b023abc3dcb26f5071c2da
2020-09-05 01:57:02 +03:00
Leonid Yuriev
b1877d08ae
mdbx: rework mdbx_chk & tree-traversal.
...
Change-Id: Idc131539426fe0cbb97a105cff2d0a12b1496bfe
2020-09-05 01:57:02 +03:00
Leonid Yuriev
9a5df2b284
mdbx: refine errors returning from get_page().
...
Change-Id: I2da37d3b35679f345324d6dd97d2a3f634449b56
2020-09-05 01:57:02 +03:00
Leonid Yuriev
6867c13bd1
mdbx: more runtime checks/errors instead of assertions.
...
Change-Id: I843f28b7faeb23f986154dd92a0e2b50d66a1dde
2020-09-05 01:57:02 +03:00
Leonid Yuriev
a758e32f91
mdbx: remove assertions from page_check().
...
Change-Id: Ic157e7fc43d9c3a84e530d0001409ff2a5c1f818
2020-09-05 01:57:02 +03:00
Leonid Yuriev
6e339fc849
mdbx: add bad_page().
...
Change-Id: I5233e4a701ee11fd59d7083576f40f7df3068ddd
2020-09-05 01:57:02 +03:00
Leonid Yuriev
f0de3ff098
mdbx: continued page-check.
...
Change-Id: Id4aa37284a12f49e359a6c9391d2fd5b6acb2ad0
2020-09-05 01:57:02 +03:00
Leonid Yuriev
d6645f84f2
mdbx: more error logging.
...
Change-Id: I3757e587514450634b5d3ebf8721c9ed4ac182f1
2020-09-05 01:57:02 +03:00
Leonid Yuriev
cd6aa4a708
mdbx: parent-page-txnid checking.
...
Change-Id: I6d37326c4ff2aa32587704b971bd650d9221b06f
2020-09-05 01:57:02 +03:00
Leonid Yuriev
cd4f732a87
mdbx: drop internal unused fields.
...
Change-Id: I634d3e0695f300df79129a15da752a23b277a0ce
2020-09-05 00:55:00 +03:00
Leonid Yuriev
b095ad872c
mdbx: add MDBX_ALLDUPS & MDBX_UPSERT, rework handling of others.
...
Change-Id: I27d437540d883935d78242e4fc7e28951ab9f496
2020-09-05 00:26:06 +03:00
Leonid Yuriev
0671114bbb
mdbx++: Add support for C++17 polymorphic allocators.
...
Change-Id: I76054829551c247a4d8f81288fc47db47ead0288
2020-09-05 00:26:06 +03:00
Leonid Yuriev
5ec0f5b299
mdbx: refine mdbx_replace_ex().
...
We can skip update only when a data exactly the same,
but user's md_dcmp() may returns zero even data is NOT matches byte-to-byte.
So to skip update the cmp_len fast() should be used instead of md_dcmp().
Change-Id: I6ad0f7cfc6a18722b46e565deef3a544ddf9968a
2020-09-05 00:26:06 +03:00
Leonid Yuriev
33b1cf2931
mdbx++: Initial C++ API (some extra methods are not implemented).
...
Change-Id: I0478d0c94dcd12b52916e87815e5731817407c3c
2020-09-05 00:26:06 +03:00
Leonid Yuriev
89dba59ce2
mdbx: refine/fix handling MDBX_MULTIPLE in the mdbx_cursor_put().
...
Change-Id: I06ac9d73cec01afb492b5c663acf310d19e4900b
2020-09-05 00:26:06 +03:00
Leonid Yuriev
426d207fc4
mdbx: fix page_get() null-defer when DB corrupted.
...
Change-Id: Ia4b5870e6718cd376d25893d33b9c659e3cd151a
2020-09-04 23:56:43 +03:00
Leonid Yuriev
362df3a031
mdbx: workaround for MSVC 19.27 static_assert() bug.
...
Change-Id: Ia143795a57e800bc39e126cd90f34a6abde81ca3
2020-09-01 21:41:52 +03:00
Leonid Yuriev
bf31cca375
mdbx-chk: fix 'differentent' typo.
...
Change-Id: Id56171bdbfe92a589f574a4803beab4abf2d9cdb
2020-09-01 20:54:15 +03:00
Leonid Yuriev
6b1c2ff762
mdbx: fix mdbx_env_open() for re-opening after non-fatal errors.
...
Change-Id: Ibbe9a8e017837a21fe1eeebb86e1b3a7a370e77c
2020-09-01 20:54:15 +03:00
Leonid Yuriev
e6696178db
mdbx++: refine exceptions.
...
Change-Id: I56d3fd4716320af7a5aec1824fbded5f9efc416c
2020-09-01 16:20:17 +03:00
Leonid Yuriev
500609736c
mdbx++: rename default_allocator to legacy_allocator.
...
Change-Id: I48118a9424be3063b916c00c73715aed4e244ac8
2020-09-01 14:46:37 +03:00
Leonid Yuriev
883c9f960c
mdbx++: don't use obsolete MDBX_MAPASYNC.
...
Change-Id: I328772a36d14a7593f3b9ee31796fb33d30de7b0
2020-09-01 14:12:12 +03:00
Leonid Yuriev
cd9ac17d59
mdbx++: Done rest of NOT_IMPLEMENTED.
...
Change-Id: I4707416ce4a7b41a04824749be34e338d73f9ea0
2020-09-01 14:12:12 +03:00
Leonid Yuriev
baeca4109a
mdbx++: Implements std::ostream << operators.
...
Change-Id: Iec4b6fc0344e3d3f3ff665ce28e23c2f315d8bdb
2020-09-01 13:23:03 +03:00
Leonid Yuriev
62be36cc9e
mdbx++: is_printable() for UTF8.
...
Change-Id: I96a58dc97e2f4261eafceb358a1dca7ba55cfa0d
2020-08-31 16:35:49 +03:00
Leonid Yuriev
ee902621db
mdbx++: Implements most of C++ API (except related for iostreams).
...
Change-Id: Ia61c208506c3d94700a240725cb854275c7de087
2020-08-31 16:34:58 +03:00
Leonid Yuriev
6ca0f144fa
mdbx: workaround for MSVC 19.27 static_assert() bug.
...
Change-Id: Ia143795a57e800bc39e126cd90f34a6abde81ca3
2020-08-31 02:35:11 +03:00
Leonid Yuriev
eca3904dfa
mdbx++: minor fix env::setup().
...
Change-Id: I751cbf5c9d1d83a3b4da2af1f5950d85ce2934cd
2020-08-29 16:36:30 +03:00
Leonid Yuriev
12e19cedc0
mdbx: minor fix mdbx_replace_ex().
...
Change-Id: I2e1f27b1d73b450643743cf9d4ad35d5cd4547de
2020-08-29 16:36:30 +03:00
Leonid Yuriev
317816d6c7
mdbx: refine/simplify mdbx_cursor_del().
...
Change-Id: Ibd72817a33427483a4440eecc911815420b2e13f
2020-08-29 14:46:15 +03:00
Leonid Yuriev
1d48cb88fe
mdbx: Add mdbx_txn_break().
...
Change-Id: Id38a09a0a95d092d75f2eb4fad2cbd7805cd59d0
2020-08-28 21:20:51 +03:00
Leonid Yuriev
04a77d3bf3
mdbx: add MDBX_ALLDUPS & MDBX_UPSERT, rework handling of others.
...
Change-Id: I27d437540d883935d78242e4fc7e28951ab9f496
2020-08-28 19:08:45 +03:00
Leonid Yuriev
aa7695c513
mdbx++: Add support for C++17 polymorphic allocators.
...
Change-Id: I76054829551c247a4d8f81288fc47db47ead0288
2020-08-28 16:45:30 +03:00
Leonid Yuriev
08faeda430
mdbx: refine mdbx_replace_ex().
...
We can skip update only when a data exactly the same,
but user's md_dcmp() may returns zero even data is NOT matches byte-to-byte.
So to skip update the cmp_len fast() should be used instead of md_dcmp().
Change-Id: I6ad0f7cfc6a18722b46e565deef3a544ddf9968a
2020-08-28 16:45:30 +03:00
Leonid Yuriev
88a4b8cb9b
mdbx++: Initial C++ API (some extra methods are not implemented).
...
Change-Id: I0478d0c94dcd12b52916e87815e5731817407c3c
2020-08-28 16:45:30 +03:00
Leonid Yuriev
e3f0db7708
mdbx: refine/fix handling MDBX_MULTIPLE in the mdbx_cursor_put().
...
Change-Id: I06ac9d73cec01afb492b5c663acf310d19e4900b
2020-08-28 16:45:29 +03:00
Leonid Yuriev
c53627f5ac
mdbx: fix null-deref during MDBX_TXN_RDONLY_PREPARE in the MDBX_EXCLUSIVE mode.
...
Change-Id: I20b2bd4137293261a546910c8175be531d38b2c9
2020-08-23 16:28:00 +03:00
Leonid Yuriev
0a75417d5f
mdbx: add pure- & const-function attributes to C API.
...
Change-Id: Ie4d1742f3d4717a0cd1fd5677b9b1ae641193d45
2020-08-23 13:29:44 +03:00
Leonid Yuriev
54a09967a1
mdbx: refine mode_t for lck-file.
...
Change-Id: I7674a3a1c0a5778f0f362faa1d608c25e242d92d
2020-08-06 01:48:56 +03:00
Leonid Yuriev
17380fe079
mdbx: minor fix for MDBX_DBG_LEGACY_MULTIOPEN.
...
Change-Id: I7d1c30699708c4b9e47e1b781e96c9a4b6c2b109
2020-08-06 01:48:56 +03:00
Leonid Yuriev
ffa10a25d6
mdbx: use enums & bool in the C API.
...
Change-Id: I952f578cceb7d02ade16f545d47245d4d9106441
2020-08-06 01:48:56 +03:00
Leonid Yuriev
3bcf808005
mdbx: separate and describe MDBX_DB_ACCEDE.
...
Change-Id: I1a846d196eb00138c1c5ec453537757b1df78d31
2020-08-06 01:48:56 +03:00
Leonid Yuriev
87de3fc25f
mdbx: add MDBX_TXN_RDONLY_PREPARE.
...
Change-Id: I95647d1679b69d1e97514a45f20d7373174244d5
2020-08-06 01:48:56 +03:00
Leonid Yuriev
1e7a1da14e
mdbx: separate transaction flags.
...
Change-Id: Ib9a0f6946e1ecf35059e2dccc91319ae130c9f9b
2020-08-06 01:48:56 +03:00
Leonid Yuriev
5e43ee61a2
mdbx: drop/deprecate MDBX_MAPASYNC.
...
Change-Id: I472f97f568a32325eb056c8ee4d2f2350a473bda
2020-08-06 01:48:56 +03:00
Leonid Yuriev
135bead730
mdbx: disable warning C4204 for MSVC.
...
Change-Id: Idf7246f5ee349294cea1ed15d69daa49e4dddedb
2020-07-31 01:33:16 +03:00
Leonid Yuriev
7ce33be933
mdbx: fix zero-length arrays for C++.
...
Change-Id: I24ee4b34064f1face40d63861fb2f8982b922f7d
2020-07-31 01:33:16 +03:00
Leonid Yuriev
f4021c8028
mdbx: refine mdbx_dump_val().
...
Change-Id: I72dac7c44c842d16d6b8776248ba20014d0709a9
2020-07-31 01:33:16 +03:00
Leonid Yuriev
0a01b46112
mdbx: add mdbx_thread_register() and mdbx_thread_unregister().
...
Change-Id: I605bc75a20631e781043fafcc26f5e59cb40adaa
2020-07-31 01:33:16 +03:00
Leonid Yuriev
b91918b027
mdbx: add mdbx_env_get_maxdbs().
...
Change-Id: Ie4bdd2f8a46130f277ef98861a5fca98f55bad54
2020-07-31 01:33:16 +03:00
Leonid Yuriev
9e90718bd5
mdbx: add check_env().
...
Change-Id: Iff9258d1e31349da77ef030cfe6da7bcfc5c5a19
2020-07-31 01:33:16 +03:00
Leonid Yuriev
0387d6f6d4
mdbx: rename MDBX_ENV_CHECKPID.
...
Change-Id: Id0afbea99b0747c6d7a5062c1c4a82ebc69f4f40
2020-07-31 01:33:16 +03:00
Leonid Yuriev
1e3c4dc0ef
mdbx: define & use bool type for C API.
...
Change-Id: Icb6cd635a4813bfc92d31bdc527414bdddce4a63
2020-07-31 01:33:16 +03:00
Leonid Yuriev
c778d3cfd4
mdbx: bump version to 0.9.x (not a release, but API changes).
...
Change-Id: I756f1224739df53d8503cf308c2c908f6ecd3fd1
2020-07-31 00:45:34 +03:00
Leonid Yuriev
dcd61289d8
mdbx-doc: more for Doxygen (refs, build options).
...
Change-Id: I8b15bce3d6638a24bdafa3171ae10f01311862d7
2020-07-29 02:18:44 +03:00
Leonid Yuriev
a902538e34
mdbx: more Doxygen tags (almost done).
...
Change-Id: I696e717e37a905f68af059c51f9df327c257332e
2020-07-24 22:49:21 +03:00
Leonid Yuriev
2cd7fcb16d
mdbx: fix minor Coverity issues.
...
Change-Id: I21c44de18e4e620ecec38ec837446150736faf79
2020-07-24 17:43:35 +03:00
Leonid Yuriev
5f4f828bae
mdbx-doc: provide non-API docs via doxygen (squashed).
...
Change-Id: Ie33858517f964f794ec182a1e8bb630730a0f172
2020-07-23 18:44:32 +03:00
Leonid Yuriev
3d31884c3b
mdbx-chk: always skip key ordering checking to avoid MDBX_CORRUPTED
when using custom comparators.
...
Change-Id: Ieb6ea4a1c36b0e661afc13da365505ffbb5d0b5e
2020-07-23 11:47:05 +03:00
Leonid Yuriev
9720ed39f5
mdbx: using enum
instead of #define for flags/modes.
...
Resolve https://github.com/erthink/libmdbx/issues/108
Change-Id: I45897300375d2b5b9361aaba81dadcf9801fe3cf
2020-07-08 02:26:46 +03:00
Leonid Yuriev
2e0d2e65af
mdbx: fix minor typos.
2020-07-07 23:16:43 +03:00
Leonid Yuriev
e989cb05ed
mdbx: deprecate mdbx_dbi_open_ex() and custom comparators.
...
Change-Id: I1d20f77b9ba5d8d5ec891df17019377afb466b06
2020-07-07 19:33:59 +03:00
Leonid Yuriev
fab6ddee14
mdbx: add MDBX_DEPRECATED macro.
...
Change-Id: I87e14b37a6d152fa1f69f4a74e16244870dedb0f
2020-07-07 19:33:17 +03:00
Leonid Yuriev
3351c1f869
mdbx: implements remapping of the database file when it it possible.
...
Change-Id: Ida15ba1f396a33b2c6063e680dff612f39a9608f
2020-07-06 16:23:52 +03:00
Leonid Yuriev
2d0a5c42a9
mdbx: avoids unnecessary remap in case geometry changed concurrently by another process(es).
...
Change-Id: Ibf3a90bc79b1e8e0fa752dabc21b129a697c08d4
2020-07-06 14:35:41 +03:00
Leonid Yuriev
5dbb0b4cfe
mdbx: rename internal flags & fields for clarity.
...
Change-Id: I79d6d8e88b0b4c30cbb8a464ca17f07dc2ab44c6
2020-07-06 14:35:41 +03:00
Leonid Yuriev
c22749a630
mdbx: add TODO for auto-recovery.
...
Change-Id: I7d5fd83a2fdeaec0501ba0339bbe865d06356bad
2020-07-05 00:34:32 +03:00
Leonid Yuriev
e6f5998b76
mdbx: refine mode bits while auto-creating LCK-file.
...
Change-Id: Ideb603cf6a1709188b3c121a9d6bf2097b9c244d
2020-07-05 00:34:32 +03:00
Leonid Yuriev
e6eeed6cf2
mdbx: return MDBX_CORRUPTED in case all meta-pages are weak and no other error.
...
Change-Id: I38c85738d8ccdb87856fa1a6e989ddaf75109722
2020-07-05 00:34:32 +03:00
Leonid Yuriev
5a25c7c5fb
mdbx: fix __pure_function & __const_function for CLANG & C++ exceptions.
...
This is crutch for https://bugs.llvm.org/show_bug.cgi?id=43275
Change-Id: I6d29456cd83f8e713a5b1f6b50ac721bf985148f
2020-07-05 00:34:23 +03:00
Leonid Yuriev
505ee31635
mdbx: add __fallthrough workaround for LCC.
...
Related to https://bugs.mcst.ru/bugzilla/show_bug.cgi?id=5093
2020-06-26 03:28:15 +03:00
Leonid Yuriev
0afc21eed9
mdbx: add mdbx_get_keycmp() & mdbx_get_datacmp().
...
Change-Id: I11f8a54f7eb21b0bab575c8f6b89081b7eaf1bb8
2020-06-24 17:15:56 +03:00
Leonid Yuriev
428f753c03
mdbx: add key-to-value functions.
...
Change-Id: Ie0acd8c58833047931444fd9d94d5b82e6d541bb
2020-06-24 17:15:56 +03:00
Leonid Yuriev
0fc2d39cce
mdbx: allow mixind with/without MDBX_WRITEMAP for the same database.
...
Change-Id: I916bb9e9b44a58cf78786e76a8c42d62e0bfc579
2020-06-20 23:55:15 +03:00
Leonid Yuriev
35313d18bc
mdbx-posix: refine mdbx_lck_init(), allow multi-opending with MDBX_LOCKING_SYSV.
2020-06-15 12:51:35 +03:00
Leonid Yuriev
e008f3132d
mdbx: support for huge transactions (MDBX_HUGE_TRANSACTIONS option).
...
Change-Id: I5d6cce6a7fb816add8cb4c066cc50f31cdebf9d5
2020-06-13 03:06:20 +03:00
Leonid Yuriev
7ab9d24d3b
mdbx: fix env_set_geometry() for opened-env + outside-txn case.
...
Change-Id: I4526aa8011895ef7b5529995503966117c37e107
2020-06-08 19:12:12 +03:00
Leonid Yuriev
03cc19babb
mdbx: preserve error from env_set_geometry() inside setup_dxb().
...
Change-Id: I8dae0b38eb09cfaa07cdd80cb37dc414e2f99d7a
2020-06-08 19:12:12 +03:00
Leonid Yuriev
0117473cbc
mdbx: bump version to 0.8.x
...
Change-Id: I6d2a1a3b04341461288e18c66d11e79d343750b0
2020-06-05 03:00:43 +03:00
Leonid Yuriev
36dc9e26b6
mdbx: avoid forward-invalidation of DBI-handle when it just closing.
...
Change-Id: I379f07c2eae9ea68ddf554d10d7d1deed1a00d2b
2020-06-04 12:24:11 +03:00
Leonid Yuriev
0146b3e2c0
mdbx: avoids using pwritev() for single-writes (up to 10% speedup for some kernels & scenarios).
...
Change-Id: I71fbf0e113b1de4d05b2a43e8532a977c42b8f91
2020-05-29 18:39:43 +03:00
Leonid Yuriev
a159ae4b06
mdbx-tools: fix using ENODATA for FreeBSD.
...
Change-Id: I3092e79116de96aa5e12e61e0963dc7545a1cf1b
2020-05-27 23:16:12 +03:00
Leonid Yuriev
ea353471d5
mdbx: fix minor typo.
...
Change-Id: I02ab17d1867e8b1a0b9ef971c9922688eca9dc7c
2020-05-27 21:48:14 +03:00
Leonid Yuriev
1f301e7e6f
mdbx: explicit sync lck-file after re-write/re-create.
...
Change-Id: I2fad76b1d04e4b0cd2ca08cb722bd819153f9824
2020-05-27 21:48:14 +03:00
Leonid Yuriev
5cc1cb3f87
mdbx: add mdbx_dbi_dupsort_depthmask().
...
Change-Id: Ib056663f26baea517d6f2b9d58cd64c643619ef9
2020-05-25 14:53:38 +03:00
Leonid Yuriev
51a016245a
mdbx: using couple of condvars/events to avoid glitches on Windows.
...
Change-Id: I3256a8dcbb95c78e8dea3eb31ca73f42c58d2f61
2020-05-24 13:29:55 +03:00
Leonid Yuriev
a2bdbc97dc
mdbx: truncate clk-file when DB closed in sync-state.
...
Change-Id: I2e2438606118e3aa3fa9d60811fea99994403d32
2020-05-23 01:34:52 +03:00
Leonid Yuriev
86a4085bf9
mdbx-windows: minor cleanup lck_downgrade().
...
Change-Id: I7f36baefe3e3d76083171ae0c0f97d21ad1e877a
2020-05-23 01:34:52 +03:00
Leonid Yuriev
d1d65f8090
mdbx: removes wrong condition from the assertion.
...
Fixes https://github.com/erthink/libmdbx/issues/105
I decided to remove the extra check, since a sub-cursor cannot return data
and there is no point in adding assignments just for this check.
Change-Id: I6a983930abb37b8f6ab768602763495572adf7fd
2020-05-22 22:12:08 +03:00
Leonid Yuriev
78e592579a
mdbx: refine update_gc() for small pages with huge transactions.
...
Change-Id: I66080e11a780a6a711691918179bc21d9a121347
2020-05-17 19:16:35 +03:00
Leonid Yuriev
d3e609d7ff
mdbx: simplify page-merge for LEAF2.
...
Change-Id: I25ad34f02b86b47562fc3c74f5454432f687cbde
2020-05-17 19:16:19 +03:00
Leonid Yuriev
5e2067decd
mdbx-tools: use MDBX_ACCEDE to open DBI with custom comparators.
2020-05-15 22:03:29 +03:00
Leonid Yuriev
6fa2748fc7
mdbx-tools: refine mdbx_stat.
2020-05-15 22:03:29 +03:00
Leonid Yuriev
efe4fd2cc9
mdbx-tools: use equal-or-greater comparator for dont-check-ordering mode.
2020-05-15 22:03:29 +03:00
Leonid Yuriev
3f0d2a6ac2
mdbx-tools: extends dump/load to support all mdbx attributes.
...
Change-Id: I04772ce0083c46b70f5342e92c7509c9a425724d
2020-05-15 22:03:29 +03:00
Leonid Yuriev
8f31aad0fb
mdbx: use MAX_TXN internally (cosmetics).
...
Change-Id: Ic8171dbfa8bb32272e46e939223316f6182d3a7a
2020-05-15 18:13:10 +03:00
Leonid Yuriev
463a8af35b
mdbx: copy unaligned keys/values instead of return error to avoid break compatibility.
...
Change-Id: I2f95674a3836568a5c51155ca70da0683c50b424
2020-05-15 11:30:35 +03:00
Leonid Yuriev
c2c74075e7
mdbx: fix Valgrind minor warning with MDBX_DEBUG > 1.
...
Change-Id: Idb93c6a3843e76071a55cbd6c34ddd22541c77d3
2020-05-15 11:30:35 +03:00
Leonid Yuriev
c6edd6fb91
mdbx: exclude MDBX_NOSUBDIR from persistent flags.
2020-05-15 11:30:35 +03:00
Leonid Yuriev
e28d223d42
mdbx: fix MDBX_NODUPDATA handling for key-value data.
...
More for https://github.com/erthink/libmdbx/issues/99
in continue to 9428efd2ae9f7fe984422b5eb1fc47f732236b51
Change-Id: I56050ddf5e56807a11d8613780c3ba76cc16d324
2020-05-15 11:30:35 +03:00
Leonid Yuriev
8c8c86038a
mdbx: fix unsigned-to-ptrdiff casting inside estimate().
...
Fixup after a238179c23e7378b2019de5229b2166cdfe515c7
Change-Id: I316e4aa1f41462fd0017f8e0a7f6d6e82aa4f3db
2020-05-15 11:30:35 +03:00
Leonid Yuriev
e6b48b613a
mdbx: more checking for MDBX_DEBUG.
...
Change-Id: Ie6bedda942bc5623e5d7cee5d2011e41009ea3d9
2020-05-15 11:30:35 +03:00
Leonid Yuriev
f6fe3b44de
mdbx: fix fetching of first/lower key in case starting from LEAF2-page during page merge.
...
More for b3f375c57f9ff0f1f58e77227374b1cfddcd3278
2020-05-15 11:30:35 +03:00
Leonid Yuriev
57d76d1f7a
mdbx: checking the order of keys on all pages during the audit (squashed).
2020-05-15 11:29:23 +03:00
Leonid Yuriev
30bb2363e1
mdbx: use comparators instead of is_samedata().
2020-05-15 08:59:10 +03:00
Leonid Yuriev
b7fb9bdeb1
mdbx: fix mdbx_xcursor_init1() for prev created databases.
2020-05-15 08:59:10 +03:00
Leonid Yuriev
d986d09b7b
mdbx: rework min/max length checking for keys & values (squashed).
2020-05-15 08:59:03 +03:00
Leonid Yuriev
9736a36efb
mdbx: add branch-less flags_db2sub().
2020-05-11 02:03:55 +03:00
Leonid Yuriev
e4ce115876
mdbx: fix MSVC warnings (minor).
...
Change-Id: I614ee9ec1c21586fbe08c6cedb395ac57a81914f
2020-05-10 03:56:25 +03:00
Leonid Yuriev
5b4b3fa9ea
mdbx-windows: fix MDBX_AVOID_CRT option & ntdll.def distribution.
...
Resolve https://github.com/erthink/libmdbx/issues/100
Change-Id: I18ab055e79e249fca856353b2585739c88e01758
2020-05-10 03:41:28 +03:00
Leonid Yuriev
a238179c23
mdbx: rename/reorganize internal fields for clarity.
...
Change-Id: I9b23a8ca271f30ebedda9cd8d21094b4797f8bb3
2020-05-09 20:00:31 +03:00
Leonid Yuriev
8ee3c6ddb0
mdbx: minor fix return MDBX_EBADSIGN.
...
Change-Id: Ia0da8b4c2a5f0776688c92ad50433eed5e83b73c
2020-05-09 20:00:25 +03:00
Leonid Yuriev
9428efd2ae
mdbx: avoid upsertion (early exit) the same key-value data.
...
Resolve https://github.com/erthink/libmdbx/issues/99
Change-Id: I6aac66d6cb6818951e29bc8a3626c342d6137151
2020-05-09 03:25:20 +03:00
Leonid Yuriev
86dad2d727
mdbx: drop obsolete/unused mn_hi & mn_lo.
...
Change-Id: Ie0099c5afa66ccb679b124f3feb095a364519edc
2020-05-09 03:25:20 +03:00
Leonid Yuriev
db635c9fbb
mdbx: fix/don't clean env-signature if open failed.
2020-05-09 02:48:56 +03:00
Leonid Yuriev
83cf4cd3d5
mdbx: refine/fix mdbx_dbi_open_ex() to safe concurrently opening the same handle from difference threads.
...
Change-Id: Ib01b6015bbb28eb2777f9206d6a5ac2cf9c2575f
2020-05-09 02:46:35 +03:00
Leonid Yuriev
f11607dfa6
mdbx: minor fix/workaround to avoid UBSAN traps for memcpy(ptr, nullptr, 0).
2020-05-03 01:48:12 +03:00
Leonid Yuriev
175c361018
mdbx: avoid gcc-anylyzer false-positive warnings.
2020-05-02 22:38:53 +03:00
Leonid Yuriev
b943466727
mdbx: fix missing comma in err-msg array (Coverity).
...
Change-Id: Ic441e63cf8ed14108dfe7c38e269f819879e21ce
2020-05-01 02:42:28 +03:00
Leonid Yuriev
1488457641
mdbx-tools: hide '-n' option (NOSUBDIR) since now it guessed automatically.
...
Change-Id: I8668ec919f2f90b133270a566f380066dbb8589f
2020-04-30 16:59:46 +03:00
Leonid Yuriev
b3f375c57f
mdbx: fix branch-page merge.
...
Change-Id: I48dce339d1735cd8d270f1ba1c091572daa897a6
2020-04-30 16:57:29 +03:00
Leonid Yuriev
eec465704d
mdbx: fix div-by-zero while copy-with-compaction for non-resizeable DB.
...
Change-Id: Ice7f5675c3b2864195874f2e3c4ade9148cad048
2020-04-29 18:57:00 +03:00
Leonid Yuriev
fac0d47913
mdbx: add MDBX_CP_FORCE_RESIZEABLE option.
...
Change-Id: I5fcdae7933dbbfbf8629e8a0423545a4f6b9f6b6
2020-04-29 18:57:00 +03:00
Leonid Yuriev
37abc146b4
mdbx-tools: minor refine mdbx_chk output.
...
Change-Id: I0d1b70029b861a6048bba8c0239138160c7c6425
2020-04-29 18:39:20 +03:00
Leonid Yuriev
b44520b7d1
mdbx: don't reset last txnid while copy with compactification.
...
Change-Id: Ia7c1b968ab6a21a3c178b45408088c84647276b1
2020-04-29 18:37:37 +03:00
Leonid Yuriev
eea1432e80
mdbx: auto-reset running transaction in mdbx_txn_renew().
...
Change-Id: If93ad13bb5a6dab8dd5fcb80882b5eb83fdf3dad
2020-04-26 03:32:50 +03:00
Leonid Yuriev
3b741a6d5f
mdbx: automatically abort errored transaction in mdbx_txn_commit().
...
Change-Id: I2cfac73c69a8ff46870778f174555724f8363a79
2020-04-26 03:23:04 +03:00
Leonid Yuriev
673570ec2a
mdbx: auto-choose pagesize for a large databases.
...
Change-Id: I3f8279ba077a8c31c70504d32fb619b6601cc5c4
2020-04-23 17:15:55 +03:00
Leonid Yuriev
a5fb85f0fc
mdbx: avoiding MDBX_UTTERLY_NOSYNC as result of flags merge.
...
Change-Id: Ia39de7b60a00b04a92ddf1468c995c4684f45474
2020-04-22 20:35:12 +03:00
Leonid Yuriev
21f9a445e8
mdbx: rework env_open() to auto-handling MDBX_NOSUBDIR for any exists database.
...
Change-Id: Id8a26937c9013c750323646df01c3080a909a4c0
2020-04-22 17:33:59 +03:00
Leonid Yuriev
30f7f15778
mdbx: automatic MDBX_NOSUBDIR while opening existing database.
...
Change-Id: Ieb2042d70b42bc2a572ac1083c160fa3cdbb7556
2020-04-22 16:58:38 +03:00
Leonid Yuriev
5765d92ac7
mdbx: return MDBX_EBADSIGN when mdbx_env_close() called concurrently from several threads.
...
Change-Id: I03a8c87bc51eefc5236baa52cee8b12a9f8aa0e2
2020-04-20 17:00:41 +03:00
Leonid Yuriev
83e303b059
mdbx: alter MDBX_CURSOR_FULL description.
...
Change-Id: I70d13e7503d10c6050bd17e4dd8bd814e46799af
2020-04-19 17:33:32 +03:00
Leonid Yuriev
1e9cc6b0a5
mdbx: more 'const' for API.
...
Change-Id: Iedea253733105acc4010e07a65a594f8ea52ce56
2020-04-19 17:33:32 +03:00
Leonid Yuriev
90bf7eb817
mdbx: fix/refine MDBX_BUILD_SHARED_LIBRARY definition.
...
Change-Id: If4e3d32b0ce360eb7275d962fff4b31e53926054
2020-04-17 00:37:57 +03:00
Leonid Yuriev
971f924c44
mdbx-build: rearrange source files, rework CMakeLists.txt and refine GNUMakefile (squashed).
...
Change-Id: Id73d346695011dab2f670bb9e6293a1e5a1835ca
2020-04-17 00:37:57 +03:00
Jens Alfke
f414876e99
mdbx: fixed AddressSanitizer errors after closing db.
...
Unpoison memory before unmapping, to avoid leaving dangling poisoned
address space. This caused Clang AddressSanitizer false errors after
database was closed.
More for https://github.com/erthink/libmdbx/issues/73
Close https://github.com/erthink/libmdbx/pull/93
Change-Id: I9cf19a06521330a90a62ed15317e1f966f0bd56f
2020-04-15 02:29:05 +03:00
Leonid Yuriev
ab2c98e41c
mdbx: support for Android/Bionic.
...
Change-Id: Ia6a4d8a7848ffe3e488b4a92c9ec53c61c78a9bb
2020-04-13 23:36:56 +03:00
Leonid Yuriev
595482ca57
mdbx: fix typo (extra closing parenthesis).
...
Change-Id: Icae740a640ab59dedc7608a725cc24623dba62bd
2020-04-13 23:35:08 +03:00
Leonid Yuriev
0986cb9379
mdbx-posix: fix feature-testing for PTHREAD_MUTEX_ROBUST.
...
Change-Id: I16f008b8448a70d4145ba2bcfe22b3326c8a0e21
2020-04-13 22:46:55 +03:00
Leonid Yuriev
abf38e97cc
mdbx: minor fix prev commit.
...
More for https://github.com/erthink/libmdbx/issues/97
Change-Id: I09ffe3430aa07bf5b01d9ad991affa004bb998a6
2020-04-11 20:51:24 +03:00
Leonid Yuriev
f89c3eda17
mdbx: crutch for WSL.
...
Fixes https://github.com/erthink/libmdbx/issues/97
Change-Id: Ia863ffc8cd939b1af65f21ab0c5c8197abf4e793
2020-04-11 20:33:36 +03:00
Leonid Yuriev
5a81413f17
mdbx-posix: fix comment typo.
...
Change-Id: I4573926a50ba392222dc738be3a7b9b3fabbb368
2020-04-11 17:21:36 +03:00
Leonid Yuriev
c590eb656f
mdbx: fix null-deref in an ASAN-enabled build while opening DB with error.
...
More for https://github.com/erthink/libmdbx/issues/95
Change-Id: I6250fe7b0fbbcae497c2b5c1da9b4e9f78ecf0f0
2020-04-11 14:55:03 +03:00
Leonid Yuriev
17d7d48281
mdbx: fix null-deref in an ASAN-enabled build while opening DB with MDBX_RDONLY.
...
Fixes https://github.com/erthink/libmdbx/issues/95
Change-Id: I1c000d3a456897f73367a590ef9fbda8ae90391c
2020-04-11 03:06:05 +03:00
Jens Alfke
48b6f76159
mdbx: Don't include <sys/vmmeter.h> on Apple platforms ( #94 )
...
A simpler fix for the issue of this header being missing on iOS.
It's not actually needed at all on Mach-based OSs.
Fixes https://github.com/erthink/libmdbx/issues/92
2020-04-10 21:40:58 +03:00
Leonid Yuriev
99f07f5054
mdbx: add iOS notes to README.
...
Change-Id: Ia46a43376370a73b179dbc4ab65e43956ee8c43a
2020-04-08 02:05:18 +03:00
Leonid Yuriev
81dca1f7e9
mdbx-cmake: add MDBX_BUILD_TOOLS option.
...
Change-Id: Ib6329fdea66dd52720021b80a6fecdaa078ceb2b
2020-04-07 23:06:18 +03:00
Leonid Yuriev
ed6863851e
mdbx: crutch for iOS.
...
Workaround for https://github.com/erthink/libmdbx/issues/92
Change-Id: Id8ed900d1310212ae0edd4bf6ab11bdba9c106a1
2020-04-07 17:35:49 +03:00
Leonid Yuriev
921f43da6f
mdbx: fix ceiling/flooring madvise-edge inside mdbx_sync_locked().
...
Fixes https://github.com/erthink/libmdbx/issues/91
Change-Id: I17da72d9a53a2c7453d81488bd3297063de0b7d1
2020-04-07 03:54:48 +03:00
Leonid Yuriev
94e58d7acc
mdbx: more explicit casting to size_t (paranoia).
...
Change-Id: I1c65943cdcdd77cc12bc27d9ced19765ea7911bb
2020-04-07 03:48:23 +03:00
Leonid Yuriev
bf0cff9a8a
mdbx: add & use floor_powerof2().
...
Change-Id: Ib5be7d5a68dc7944e208d75094050383ccdfa6d0
2020-04-07 03:48:20 +03:00
Leonid Yuriev
a846fb0d21
mdbx: rename roundup_powerof2() to ceil_powerof2().
...
Change-Id: Ie22f10ffa6637ef74f2c705fad5fc45a8d19d22e
2020-04-07 03:45:11 +03:00
Leonid Yuriev
4ad1c2daed
mdbx: minor fix/workaround to avoid GCC 10.x pedantic warnings.
...
Change-Id: If67c1ae593ad2c39130054475c37321dca761f5b
2020-04-07 01:54:58 +03:00
Leo Yuriev
3f7c9846e7
mdbx: use uintptr_t instead of size_t for pointer-wide values and types.
...
More for https://github.com/erthink/libmdbx/issues/88
Change-Id: Ic625096df3c09d0dd578c7b79aa302be35480699
2020-04-04 16:52:44 +03:00
Leo Yuriev
75de63dff1
mdbx: refine type-casting inside mdbx_thread_self() to avoid warning.
...
2 of 2 for https://github.com/erthink/libmdbx/issues/88
Change-Id: Ic4994141d23a5417b18f6b03a3e4038859fb9210
2020-04-04 16:52:42 +03:00
Leo Yuriev
089d7212e7
mdbx: fix mdbx_build_info for undefined flags case.
...
1 of 2 for https://github.com/erthink/libmdbx/issues/88
Change-Id: I079b329abe8f20793dc78c90ea55f874693dde43
2020-04-04 16:52:39 +03:00
Leo Yuriev
d329ea1fe0
mdbx-tools: fix txnid_t casting inside mdbx_stat.
...
Change-Id: I69799d8caca3e6692a433b2e62e7b2867b152b00
2020-04-04 16:01:05 +03:00
Leonid Yuriev
8f5ae79b51
mdbx: bump version to 0.7.x
...
Change-Id: I6cb06fbd7119eed086b54a9760db1e0edf5de07b
2020-03-18 17:19:12 +03:00
Leonid Yuriev
251d34d6e6
mdbx-doc: more for custom comparators.
...
Change-Id: I3326c5bdedbbdb01b1865bff68aa7ba8bc7056cc
2020-03-02 13:50:33 +03:00
Leo Yuriev
76e29c21f1
mdbx: merge branch 'devel' (crutches for Wine).
...
Change-Id: I1779bc6987449e403216584cdd2846e910f34c8a
2020-02-28 19:05:47 +03:00
Leo Yuriev
5072b45026
mdbx: rename MDBX_MAP_RESIZED to MDBX_UNABLE_EXTEND_MAPSIZE.
...
Change-Id: I22fbdb4f08fd7a6ae37da42e6827677ae8a8337b
2020-02-28 16:40:56 +03:00
Leo Yuriev
63449a44c5
mdbx-cmake: #if/#endif instead of cmake-conditions for posix/windows sources.
...
Change-Id: Ic95bd3ba345160cf1d68c79f11d6560d4c41cb2b
2020-02-28 15:51:12 +03:00
Leonid Yuriev
ecffc831fa
mdbx-tools: avoids extra error messages "bad txn" from mdbx_chk when DB is corrupted.
...
Change-Id: I6b92aced83bcf7e0c8e5c7108ddcf60714c9b30c
2020-02-27 16:04:00 +03:00
Leonid Yuriev
6248b67f75
mdbx-windows: more for running under Wine.
...
Wine unable create mapped-view large tran secton size.
More for https://github.com/erthink/libmdbx/issues/83
Change-Id: I93e98d58a827c785f8257cd9cac387a333e59621
2020-02-24 20:46:36 +03:00
Leonid Yuriev
fbf55e17cb
mdbx-windows: one more workaround for Wine.
...
SetFileInformationByHandle() is not implemented by Wine.
Change-Id: I61783c8d173397094cd6cbad7efc9d7aac57b470
002c:Call KERNEL32.SetFileInformationByHandle(00000060,00000006,0022f890,00000008) ret=127dd1b2
002c:fixme:file:SetFileInformationByHandle 0000000000000060, 6, 000000000022F890, 8
002c:Ret KERNEL32.SetFileInformationByHandle() retval=00000000 ret=127dd1b2
Related to https://github.com/erthink/libmdbx/issues/83
2020-02-22 20:02:17 +03:00
Leonid Yuriev
289f2896d0
mdbx-windows: more for Wine.
...
Related to https://github.com/erthink/libmdbx/issues/83 .
UnlockFile() cold return ERROR_LOCK_VIOLATION when file not locked, instead of ERROR_NOT_LOCKED.
Current versions of Wine seem to work correctly.
Change-Id: Ibc5bd4352184efc7f88705e7ae04d6656286a96e
2020-02-21 19:58:32 +03:00
Leonid Yuriev
4fed2d9fc0
mdbx-windows: minor workaround for MSVC "unresolved external symbol __except1 ..."
...
Workaround for MSVC error LNK2019: unresolved external symbol __except1 referenced in function __ftol3_except.
2020-02-19 16:31:25 +03:00
Leo Yuriev
9aa816dc73
mdbx-windows: using RegGetValueA() instead of wchar_t version.
...
Change-Id: I0848eaf2083985ae27fec605358329830b0733c2
2020-02-19 16:00:40 +03:00
Leo Yuriev
f750086bc1
mdbx-windows: rework workaround for Wine.
...
Resolves https://github.com/erthink/libmdbx/issues/83
in accordance with https://bugs.winehq.org/show_bug.cgi?id=48620
Change-Id: Ieb4385efdcd86c865184a783363cf6e90da14f61
2020-02-18 22:51:34 +03:00
Leonid Yuriev
bd3f234bce
mdbx: update github repo address.
...
Change-Id: Ifa8bf0e09b297ba6f495dd8e04e5c67f6626d9cb
2020-02-18 02:22:47 +03:00
Leo Yuriev
60a6560a3b
mdbx: workaround for NtExtendSection() on Wine.
...
This fixes https://github.com/erthink/libmdbx/issues/83
Change-Id: I8e00aa91c86348fad9dbe4285143671d9cb3f802
2020-02-17 22:55:17 +03:00
Leo Yuriev
d1173a1596
mdbx: drop unused WindowsNT API prototypes.
...
Change-Id: Ic929646653d0576671d6150a698e892d2145ae30
2020-02-17 19:44:05 +03:00
Leonid Yuriev
2356f3281b
mdbx: use underscores for GNU-attributes.
...
Change-Id: Iefd371dd91da1db8ee86554208536b3004535317
2020-02-17 14:01:11 +03:00
Leonid Yuriev
cd0d84dbb6
mdbx: fix error message typo.
...
Change-Id: I25db309ff4fb063893c7c39d623e62eaceb8b60f
2020-02-03 23:35:43 +03:00
Leonid Yuriev
8214d674be
mdbx: refine SEARCH_IMPL macro.
...
Change-Id: I975e480c047b88e0200aaf889334e8b83ab760ad
2020-02-03 18:13:17 +03:00
Leonid Yuriev
62a39d84b3
mdbx: fix aligned_alloc() usage.
2020-02-02 20:49:51 +03:00
Leonid Yuriev
6009bac1ed
mdbx: move is_powerof2() and roundup_powerof2() into header.
2020-02-02 20:41:04 +03:00