Commit Graph

842 Commits

Author SHA1 Message Date
Leonid Yuriev
0639f54280 mdbx-test: add 'append' testcase.
Change-Id: I71620ea1a019e16b8e3d84a81dcc042961eae5b5
2019-02-04 01:41:11 +03:00
Leonid Yuriev
73bef80347 mdbx-check: add checking for complete duplicates.
Change-Id: I8308b725418ef69188eeadfc656dead4ce9cee27
2019-02-04 01:32:15 +03:00
Leonid Yuriev
460751bc01 mdbx-chk: add '-i' option for custom comparators.
Change-Id: Ie3d7fdb3c3a881a484d351ca9a3160eb467b43b9
2019-02-04 01:32:15 +03:00
Leo Yuriev
309955be75 mdbx-load: add '-a' option for loading dumps of custom-sorted DBs.
Based on http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=commitdiff;h=aa77c832b8e6fc696078017f550d119cdfc0f232

Change-Id: If7de71c8f6ffc29d4316c6074995fab38f2c1b4b

+load

Change-Id: Iff6cbca2514840ee290f801e3b273edf160913b4
2019-02-04 00:06:39 +03:00
Leo Yuriev
9ba8434c1d mdbx: fix __ANDROID__ typo.
Thank to Howard Chu <hyc@openldap.org>.

Change-Id: Ibcbe2e4790a5df5758d9fd6c621793ea42a94682
2019-02-03 17:53:00 +03:00
Howard Chu
bfffaa66b8 mdbx: import - tweak mdb_page_split (ITS#8969).
Bump up number of keys for which we use fine-grained splitpoint search

Change-Id: Icca2e1953cbcd6898b790f657636c2195b397790
2019-02-03 13:07:17 +03:00
Leo Yuriev
9cc9116df3 mdbx: 2019 HNY.
Change-Id: Iec6b7affedef0ea89fad917eb17af7e8201a7482
2019-02-03 12:28:01 +03:00
Leonid Yuriev
08508d34b3 mdbx: MDBX_BAD_DBI instead of MDBX_NOTFOUND in case table was dropped.
Change-Id: I2894a5721d2be2bb982e7c7a607c6a0413f7e3ca
2019-01-27 00:17:57 +03:00
Leonid Yuriev
5fd05db6ea mdbx: minor fix/refine mdbx_txn_straggler() for r/w-txn.
Change-Id: Id44a1db414de457d74a3e1d9d5c96064a7278080
2019-01-17 23:14:25 +03:00
Leonid Yuriev
4708e0cf79 mdbx-winfdows: fix returning negative value on failure.
Change-Id: Iaf5fb1f0cbcc3c14e2d3edf1f57538ecc0dfdf00
2019-01-17 23:10:04 +03:00
Leonid Yuriev
624968b74c mdbx-windows: use SetFileInformationByHandle() when available.
Change-Id: I27d9d4271d4328947ad68cdf30af61a31978b4f9
2018-12-28 13:53:57 +03:00
Leonid Yuriev
f778f4a795 mdbx: add MDBX_SAFE4QEMU option for testing under QEMU.
Change-Id: Ide674e0125e2746f73a7ba44828316a60633e887
2018-11-26 19:08:30 +03:00
Leo Yuriev
f55e1ec5cc mdbx-windows: more safety/robustness for DB shriking. 2018-11-22 17:50:49 +03:00
Leo Yuriev
35f95e8ca2 mdbx-windows: always susppend local threads while resize DB (workaround for Windows kernel bug).
We should not concern about performance on Windows platform,
it just unreasonable. Therefore just always suspend the local
threads to avoid this issue.

This resolves https://github.com/leo-yuriev/libmdbx/issues/48
2018-11-22 14:19:49 +03:00
Leonid Yuriev
ee7ebe438c mdbx: fix AddressSanitizer issue for mdbx_page_loose (minor, not a bug).
Change-Id: I0e550dabdeda92759c28d4566104ff07a92d83bb
2018-11-22 02:52:25 +03:00
Leonid Yuriev
f626acb398 mdbx: relax DBI-sequences for concurrent open DBI-handles for present tables.
Change-Id: I7f07d2e716074bd9c2847aeb062e366f46cca214
2018-11-19 13:31:44 +03:00
Leo Yuriev
eda424ff71 mdbx: rename __always_inline. 2018-11-06 21:08:28 +03:00
Leonid Yuriev
d5320d9252 mdbx: silently put mm_geo.now into [geo.lower...geo.upper] boundaries.
Copy-with-compaction by previous version of libmfbx could produce
DB-file less than meta.geo.lower bound, in case actual filling
is low or no data at all.

This is not a problem as there is no damage or loss of data.
Therefore it is better not to consider such situation as an
error, but silently correct it.

Change-Id: Ia662656cc3584c07efcfbdfc80f80e3c76e6dd59
2018-11-05 14:34:12 +03:00
Leonid Yuriev
3c684010e3 mdbx-tools: fix minor MSVC warnings.
Change-Id: If8b042e2d84bfed7f8b0a81a4d75d7be7e7aa7a9
2018-11-05 00:31:58 +03:00
Leonid Yuriev
aa52cb395f mdbx: fix typo in mdbx_limits_dbsize_max().
Change-Id: Ie55e3ca108ac6aab9a41d65f316a3d5ff5ff6f1f
2018-11-05 00:18:41 +03:00
Leonid Yuriev
2770e193b6 mdbx: take in account shrink/growing thresholds while copy-with-compactification.
Change-Id: Id93e62089819dfcc8cbc83620e0bdd806d8c1950
2018-11-04 20:34:16 +03:00
Leonid Yuriev
83f1effff1 mdbx: refine mdbx_env_copy() internals.
Change-Id: I9e8f0dc87398564524a5ec98eda2cb9bde100909
2018-11-04 20:34:16 +03:00
Leonid Yuriev
629637d95e mdbx-osal: add mdbx_fseek().
Change-Id: I5744aa3ba51bd1acaeedd866e6b21a1330c3f711
2018-11-04 20:34:16 +03:00
Leo Yuriev
06cb8b45b2 mdbx: fix PRIuPTR/PRIu64 for 32-bit builds.
Change-Id: Ic6462666de666840bc77e0e50fd0d8cd36a125b7
2018-11-04 20:34:16 +03:00
Leonid Yuriev
2d5cba61ed mdbx: fix assertion.
Change-Id: Ib0f19394c42f810f74e3889c21f62ae40ec0f2ea
2018-10-21 21:34:08 +03:00
Leonid Yuriev
124c5a6751 mdbx: fix mdbx_txn_abort().
This resolves https://github.com/leo-yuriev/libfpta/issues/20
2018-10-21 20:27:49 +03:00
Leonid Yuriev
3bae0723b7 mdbx: refine mdbx_mutex_failed(). 2018-10-21 20:27:49 +03:00
Leonid Yuriev
5400ef6512 mdbx-windows: fix mdbx_assert_fail(). 2018-10-21 20:27:49 +03:00
Leonid Yuriev
718f997502 mdbx-windows: workaround for Windows10 bugs.
This resolves https://github.com/leo-yuriev/libmdbx/issues/47
2018-10-21 20:27:49 +03:00
Leonid Yuriev
c2f850b566 mdbx-windows: STATIC_ASSERTs for atomic ops.
Change-Id: I9797eece26db54e5f4a19f82d004ff18bdc138d6
2018-10-21 20:27:34 +03:00
Leonid Yuriev
f93cca3d14 mdbx-windows: minor simplify MDBX_srwlock.
Change-Id: I1db8e7dab2a3c764fdbe64923cfaab238eacc77e
2018-10-21 20:27:05 +03:00
Leonid Yuriev
ecf214ca04 mdbx-windows: add MDBX_AVOID_CRT.
Change-Id: I08233d777b318037372ec250c754f093b3047c94
2018-10-19 15:16:33 +03:00
Leonid Yuriev
06e39e2728 mdbx: fix mdbx_dbi_sequence().
Change-Id: Ic620896ef42c1c2d85c07c146b72e773ab43a67d
2018-10-19 13:33:54 +03:00
Leonid Yuriev
3c4e9443ae mdbx: allow devel-signatures (for Miranga-NG).
Binary format of v0.1.x and v0.2.x is frozed.

This commit allows to open DBs created early by devel-versions of libmdbx.
It seems to be required for Miranda-NG users, but no one else.

Change-Id: Icf1d0477dcc3d212e03c87ab8c5255c3382425e5
2018-10-15 12:30:24 +03:00
Leonid Yuriev
d2bfb2e489 mdbx: allow pre-define mdbx_malloc/mdbx_free macros.
Related to https://github.com/leo-yuriev/libmdbx/issues/43#issuecomment-429625047

Change-Id: Icaee4ba62003e6eacef9f938bdea19426623b5da
2018-10-14 19:06:42 +03:00
Leonid Yuriev
30a80ff07c mdbx: re-enable usage of lck-file in MDBX_EXCLUSIVE mode.
Otherwise we should prohibit running read-only and write
transactions simultaneously, but no reliable way to do this.

Change-Id: I8805f10b37ffcddb612d869309b1cd5e04cfcc1e
2018-10-14 18:15:26 +03:00
Leonid Yuriev
582adda628 mdbx-windows: fix mdbx_strdup() usage.
Fix commit e229dbe9dc (12 of 17 for https://github.com/leo-yuriev/libmdbx/issues/43).

Change-Id: Ic63864d736319ccba37518a50590f4e21282a451
2018-10-14 17:36:15 +03:00
Leonid Yuriev
ae83982811 mdbx-windows: setup DllMain() as entry and don't linking with CRT.
17 of 17 for https://github.com/leo-yuriev/libmdbx/issues/43

Change-Id: Ie3b37633ab081ca4ba2dc485e67de96df032a3df
2018-10-14 15:03:52 +03:00
Leonid Yuriev
25ab7da33e mdbx-windows: _NO_CRT_STDIO_INLINE to avoid dependency from CRT.
16 of 17 for https://github.com/leo-yuriev/libmdbx/issues/43

Change-Id: Ie5d33e2a4f1fd281a28eaa6686aaf921ecc956b4
2018-10-14 15:03:38 +03:00
Leonid Yuriev
96491db229 mdbx-windows: building and linking mdbx_ntdll_extra.lib
15 of 17 for https://github.com/leo-yuriev/libmdbx/issues/43

Change-Id: I6241d08f14dcd59c6c55aa26660bdec233fb3c94
2018-10-14 15:03:17 +03:00
Leonid Yuriev
d520df6a13 mdbx-windows: add ntdll.def for building ntdll.lib
14 of 17 for https://github.com/leo-yuriev/libmdbx/issues/43

Change-Id: I492b4be913f0a14540e7a80b53c2a24623dfeb07
2018-10-14 15:01:15 +03:00
Leonid Yuriev
cad9cea33b mdbx-windows: use _wcsnicmp() instead of wcsnicmp() to avoid dependency from CRT.
13 of 17 for https://github.com/leo-yuriev/libmdbx/issues/43

Change-Id: I880433ddaf364a7e2b5de104ccf8689b93754ec5
2018-10-14 15:00:43 +03:00
Leonid Yuriev
e229dbe9dc mdbx-windows: add mdbx_strdup() to avoid dependency from CRT.
12 of 17 for https://github.com/leo-yuriev/libmdbx/issues/43

Change-Id: Ib1379d75dc25e34f56daf8988848c41f59b6cd6b
2018-10-14 15:00:16 +03:00
Leonid Yuriev
b47badb3ee mdbx-windows: rework mdbx_memalign_alloc()/mdbx_memalign_free() to avoid dependency from CRT.
11 of 17 for https://github.com/leo-yuriev/libmdbx/issues/43

Change-Id: Id1a76f88588251cab9a93aa9753021b30159b09a
2018-10-14 14:59:37 +03:00
Leonid Yuriev
f49741b4f8 mdbx-windows: refine mdbx_vasprintf() to avoid dependency from CRT.
10 of 17 for https://github.com/leo-yuriev/libmdbx/issues/43

Change-Id: I95c4583c27503eb4e9221b212b34474dfb561e6d
2018-10-14 14:59:09 +03:00
Leonid Yuriev
80ccb31008 mdbx-windows: avoid use strerror() from CRT.
9 of 17 for https://github.com/leo-yuriev/libmdbx/issues/43

Change-Id: I53b770e911ff8e7d4e084a323a374d09ea516986
2018-10-14 14:58:30 +03:00
Leonid Yuriev
4dea5c2719 mdbx-windows: use _snprintf() and _vsnprintf() to avoid dependency from CRT.
8 of 17 for https://github.com/leo-yuriev/libmdbx/issues/43

Change-Id: I335a12344b0f0d63462ac4195fafdb60f981f182
2018-10-14 14:57:34 +03:00
Leonid Yuriev
ded5269937 mdbx-windows: rework mdbx_assert_fail() and mdbx_panic() to avoid dependency from CRT.
7 of 17 for https://github.com/leo-yuriev/libmdbx/issues/43

Change-Id: I40dc8d6a7d1d955c13c7d328ee904f0e6f30b248
2018-10-14 14:57:03 +03:00
Leonid Yuriev
ae2875e248 mdbx: avoid on-stack allocation/chkstk inside mdbx_check4nonlocal().
6 of 17 for https://github.com/leo-yuriev/libmdbx/issues/43

Change-Id: Ib55a27c4859ff25e5b779a4514cd2e625ab99013
2018-10-14 14:56:32 +03:00
Leonid Yuriev
aa64597e8b mdbx: avoid on-stack allocation/chkstk inside mdbx_env_walk().
5 of 17 for https://github.com/leo-yuriev/libmdbx/issues/43

Change-Id: Iadb833ff38dbd0922eda69238b365f5906b9109f
2018-10-14 14:56:04 +03:00
Leonid Yuriev
180c605cac mdbx: avoid on-stack allocation/chkstk inside mdbx_reader_check0().
4 of 17 for https://github.com/leo-yuriev/libmdbx/issues/43

Change-Id: I31a8396ccc5db32cbd1816593861d2ee4325d09f
2018-10-14 14:55:30 +03:00
Leonid Yuriev
23d2f0fbb5 mdbx: avoid on-stack allocation/chkstk inside mdbx_kill_page().
3 of 17 for https://github.com/leo-yuriev/libmdbx/issues/43

Change-Id: Icff2d67f84283820fb21932c0d439d645c634d25
2018-10-14 14:54:39 +03:00
Leonid Yuriev
9fae7f92d6 mdbx-windows: use LocalAlloc/LocalFree instead of CRT's malloc/free.
2 of 17 for https://github.com/leo-yuriev/libmdbx/issues/43

Change-Id: Icb5289b55897d52ac00007f30b36bd84e5a0cbd1
2018-10-14 14:53:57 +03:00
Leonid Yuriev
ace3d1bfa3 mdbx: add mdbx_malloc/mdbx_free, etc.
1 of 17 for https://github.com/leo-yuriev/libmdbx/issues/43

Change-Id: Ia5204be9f943fefde42e6a46e652c1be6ab6a96b
2018-10-14 14:53:40 +03:00
Leonid Yuriev
777d1db5c9 mdbx-windows: add MDBX_BUILD_DLL and DllMain().
Change-Id: I715f5ea84fe77923eecbc617c4e994e3e5d44605
2018-10-08 02:19:58 +03:00
Leonid Yuriev
c9e3dc373b mdbx-windows: more for WindowsXP support.
Change-Id: Ide34048720989fc010f48e086569e12e8c1edca1
2018-10-08 02:18:32 +03:00
Leonid Yuriev
83f3d820f1 mdbx-windows: refine debug-logging. 2018-10-08 02:17:27 +03:00
Leo Yuriev
0f82db941b mdbx: add error-logging to mdbx_page_get().
Change-Id: I6a1a95ec6fc73aa7bf28875a89b1dd6c02ef5164
2018-10-08 02:14:12 +03:00
Leonid Yuriev
7a3c8743f3 mdbx: fix use _ASSERTE.
Change-Id: Iba139ddcfc6cbc93b74f3d7387492b6ae6496dcc
2018-10-08 02:14:12 +03:00
Leo Yuriev
025cf0b00e mdbx: minor fix mdbx_updage_gc().
Change-Id: Ie6bc38e86837ab0863c60500dce0c965e447b209
2018-10-01 18:11:24 +03:00
Leonid Yuriev
0b870648af mdbx-chk: use txnid as record-number for GC. 2018-09-23 12:04:10 +03:00
Leonid Yuriev
2ff1096c49 mdbx: refine mdbx_update_gc(). 2018-09-23 12:03:45 +03:00
Leonid Yuriev
cd1b9ea1cf mdbx: fix and simplify lifo-cleanup-loop inside update_gc(). 2018-09-21 02:36:35 +03:00
Leonid Yuriev
d6c954cd43 mdbx: remove txnid/me_oldest asserts.
The `mc->mc_txn->mt_txnid >= *mc->mc_txn->mt_env->me_oldest` assertion may fail
false-positive, becase me_oldest may be not updated in read-only or exclusive modes.

Change-Id: Iad57a38efa30bc9fe2392ac24657727a7ce1f584
2018-09-20 12:29:53 +03:00
Leonid Yuriev
0b4c957bd5 mdbx: fix mdbx_find_oldest() for exclusive mode.
Change-Id: I41283bcf0bd22797530c74df125bf94cd3e73d00
2018-09-20 00:05:36 +03:00
Leonid Yuriev
e73df34619 mdbx: fix Coverity warnings (minor).
Change-Id: I4fa312f3a943f20e771f5149b2d8ad7c2520bb0e
2018-09-19 22:04:34 +03:00
Leonid Yuriev
f7bd98a4ce mdbx-chk: allow gap for GC's PNL upto one page.
Change-Id: Ie051442947e7588b868cec35ef9374368bf8a1c4
2018-09-19 17:06:56 +03:00
Leonid Yuriev
82c975e174 mdbx: rework/fix cursor tracking inside mdbx_update_gc().
Change-Id: I2c320f63901a011992bc912938bc65084f63636b
2018-09-19 17:06:27 +03:00
Leonid Yuriev
4117c9f111 mdbx: move macros/inlines to fix Windows builds.
Change-Id: I48aaf6b77466bb8b13294b84de73fb6063c88190
2018-09-19 00:24:49 +03:00
Leonid Yuriev
b52e878c4f mdbx-chk: allow gap for GC's PNL upto half of page.
Change-Id: I6d6d68d1124c336f8356435eba02cb66a08c4e9c
2018-09-19 00:07:39 +03:00
Leonid Yuriev
c4e1c2b488 mdbx: refine assections (minor).
Change-Id: Ic924988b8ce043d6106df381c996dd2c8ff9ca1f
2018-09-19 00:07:39 +03:00
Leonid Yuriev
60bba72aa1 mdbx: re-define assert macro via mdbx_assert.
Change-Id: I317801ba4200bdf1aa5cacf75d21a8e633fbc48a
2018-09-19 00:07:39 +03:00
Leonid Yuriev
8e8b40e7a2 mdbx: fix update_gc() assertion.
Change-Id: I433382de0ddab41ad1530ee674ed22f9003c2779
2018-09-19 00:07:39 +03:00
Leonid Yuriev
ab5668cf29 mdbx: add MDBX_FORCE_ASSERT.
Change-Id: I68a9f7b42663ea157c7c0a5a58797c94127b45ed
2018-09-19 00:07:39 +03:00
Leonid Yuriev
d6d03639a2 mdbx: one more fix/refine mdbx_update_gc().
Change-Id: I408db79aafb317ad20e8473edc1bc30c3afb6ea9
2018-09-19 00:07:39 +03:00
Leonid Yuriev
c287f88dbd mdbx: fix update_gc() for rare case when no reclaiming was made before.
Change-Id: Ib84da8ad26f9ef538dce2472c9ee89918bf6e25a
2018-09-17 15:25:45 +03:00
Leonid Yuriev
68fd9c9908 mdbx: add mdbx_get2() for testing.
Change-Id: Icd0961e464936fa2d24fd3ed87b61de038e955c2
2018-09-17 15:25:45 +03:00
Leonid Yuriev
940138fbda mdbx: rework prefer_max_scatter inside mdbx_update_gc().
Change-Id: I6deceb73f8578d9306528e0204ba0895781057fe
2018-09-17 15:25:45 +03:00
Leonid Yuriev
35cf4bb60f mdbx: add validation for DUPSORT flags.
Change-Id: Id1f3325764fb496413d060ea0468394f7e18ae37
2018-09-17 15:25:45 +03:00
Leonid Yuriev
ff336fa65e mdbx: fix mdbx_replace().
Change-Id: I2af00f101017795ca2b967479f86e5ea7e8ad37b
2018-09-17 00:18:39 +03:00
Leonid Yuriev
49a3e04d92 mdbx: restore MDBX_SET behaviour.
Change-Id: I1ddab75fdeeff594bf4ccdb14c7ce0415feb28f8
2018-09-17 00:17:13 +03:00
Leonid Yuriev
bcbf040f5d mdbx: drop obsolete commented-out mdbx_node_add().
Change-Id: I092469e251991921b19abb72afab19dcfb70f862
2018-09-16 19:13:02 +03:00
Leonid Yuriev
40edf7e323 mdbx: refine mdbx_update_gc(), add extra audit.
Change-Id: I70b5bba977ab6fadfdffed722226ebe02abe252c
2018-09-15 15:19:16 +03:00
Leonid Yuriev
c945359858 mdbx: remove "" from debug-strings.
Change-Id: I27f9052e2d2e318f4386f40f17c321e8cbf005c0
2018-09-15 15:18:15 +03:00
Leo Yuriev
d299a2601d mdbx: add SLAPD_LMDB_LEGACY option. 2018-09-14 16:09:29 +03:00
Leo Yuriev
1fca3d4c93 mdbx: fix add-node-args asserts. 2018-09-14 16:09:20 +03:00
Leonid Yuriev
30949031c1 mdbx: check for pgno inside mdbx_page_get().
Change-Id: I2fed589d592228c7a98a8aa76f5b6489569b13d2
2018-09-14 02:04:25 +03:00
Leonid Yuriev
bf22699fb3 mdbx: avoid empty and unneeded large/overflow pages.
Change-Id: I388a60180b999889fc15a1f3f3243c007a15edc6
2018-09-13 21:49:27 +03:00
Leonid Yuriev
e08409d209 mdbx: add mdbx_cursor_check() for audit.
Change-Id: Ica2133dea40864fb746f2dea39d8c09364b1243e
2018-09-13 21:45:12 +03:00
Leonid Yuriev
70c796463b mdbx: fix tracking inside mdbx_cursor_del().
Change-Id: Ib1b3f00270d6aec18428da4caf0f173378b9b5b5
2018-09-13 21:20:48 +03:00
Leo Yuriev
561d30518a mdbx: remove needless assert. 2018-09-13 21:18:02 +03:00
Leo Yuriev
01e016e6aa mdbx: fix tracking inside mdbx_cursor_del0().
Change-Id: If65804a610730cf80d73fc31c1e62fb9bf3b6c82
2018-09-13 21:12:39 +03:00
Leonid Yuriev
94aa20febc mdbx: rework mdbx_dpage_free(), drop mdbx_page_free().
Change-Id: Ida58003b355fe0271a835a50c78b930c73806e87
2018-09-13 21:05:26 +03:00
Leo Yuriev
f22c0856bf mdbx: fix tracking inside mdbx_rebalance(). 2018-09-13 21:05:01 +03:00
Leo Yuriev
76f7c118c6 mdbx: alter mdbx_rebalance(). 2018-09-13 21:02:14 +03:00
Leo Yuriev
ff738f1512 mdbx: alter mdbx_page_merge().
Change-Id: I33a3523e0efc914f6d85dfbbf69b97dd70d6c721
2018-09-13 20:59:10 +03:00
Leonid Yuriev
36fe81edad mdbx: refine mdbx_update_key() and mdbx_cursor_put().
Change-Id: I26b97f1eecff1f03e578193aebb5592ab48dd38e
2018-09-13 20:51:16 +03:00
Leonid Yuriev
8cd0107e6a mdbx: alter mdbx_page_loose() and rework mdbx_kill_page().
Change-Id: I646b6fb6cdcd05f5058356ee38f888519403a78f
2018-09-13 20:47:24 +03:00
Leo Yuriev
cbd0b42e20 mdbx: alter mdbx_page_split(). 2018-09-13 20:37:15 +03:00
Leonid Yuriev
6d33c137f6 mdbx: fix mdbx_cursor_put().
Change-Id: I280c6f275372952ce3411e564928ad6c3387b00c
2018-09-13 20:32:07 +03:00
Leonid Yuriev
78143d9a48 mdbx: fix mdbx_node_add_leaf2().
Change-Id: I07c5f7c1e3e21cbc4699a4fee69d651ac0779aca
2018-09-13 20:31:16 +03:00
Leo Yuriev
6206b67d32 mdbx: rework move-node and split add-node. 2018-09-13 20:28:40 +03:00
Leonid Yuriev
771ac1928b mdbx: add more const (minor).
Change-Id: I8aa44db6ed5da6a70bc8a011b83ab49a8f9f47c6
2018-09-13 20:17:12 +03:00
Leonid Yuriev
b6aace0825 mdbx: refine page-type macros.
Change-Id: I9f331bf17c1de1a1402d66e8b4081f31133e2b59
2018-09-13 20:06:13 +03:00
Leo Yuriev
a30828b457 mdbx: alter mdbx_node_shrink(). 2018-09-13 19:56:53 +03:00
Leo Yuriev
ecb0e268b0 mdbx: more asserts for page-type. 2018-09-13 19:54:02 +03:00
Leonid Yuriev
b2ddd49b77 mdbx: assertions for LEAF/BRANCH-pages mixing.
Change-Id: I52ddc64b99fa5c07e2d50a52cc17989db5ab35d5
2018-09-13 19:45:06 +03:00
Leonid Yuriev
69c14f3694 mdbx: minore refine mdbx_page_alloc().
Change-Id: Ie5e5db2a0d24547544c55467cafa6237aead8c84
2018-09-13 19:44:32 +03:00
Leo Yuriev
22e7630d53 mdbx: fix MDBX_CORRUPTED due open/shrink collision. 2018-09-13 19:32:03 +03:00
Leo Yuriev
a150b791a4 mdbx: audit freeing large/overflow pages. 2018-09-13 18:15:40 +03:00
Leonid Yuriev
94b1553637 mdbx: fix mdbx_ovpage_free().
Change-Id: I453921b356f412fad59efd6ce31ddb75f0d84358
2018-09-13 18:15:40 +03:00
Leonid Yuriev
f1bb2f1ec2 mdbx: fix mdbx_gc_update() for empty list of reclaimed-pages.
Change-Id: I7386eab7e663ec8ee330705c4b202429bf9f6793
2018-09-13 18:15:30 +03:00
Leonid Yuriev
64fb9b81f3 mdbx: allow GC's PNL be partially unused. 2018-09-13 17:46:52 +03:00
Leo Yuriev
6fb628d88d mdbx: require data == NULL for mdbx_cursor_get(MDBX_SET). 2018-09-13 17:45:26 +03:00
Leo Yuriev
7ffff48fdc mdbx: rework mdbx_update_gc(). 2018-09-13 17:40:55 +03:00
Leo Yuriev
cbafb3f471 mdbx: update DBXs with cursor-tracking. 2018-09-13 17:40:55 +03:00
Leonid Yuriev
7ce1a4c0cf mdbx: clarify mdbx_backlog_size().
Change-Id: I42170dded36b7259f61c028fefb72691ff791388
2018-09-13 17:40:55 +03:00
Leo Yuriev
e00dce3543 mdbx: rework PNL, DPL and TXN lists.
Change-Id: I79c7399912516b17cc255fc8e24b5941338e5eb1
2018-09-13 17:40:55 +03:00
Leo Yuriev
8f51b6bac2 mdbx-tools: fix ENOMEM for Windows (minor). 2018-09-13 17:40:55 +03:00
Leonid Yuriev
289da70a67 mdbx: fix max_keysize (TODO).
Change-Id: I660b1b3e454d9b51a24d3b4cc987c8e2980bd435
2018-09-13 17:19:06 +03:00
Leo Yuriev
0be592530e mdbx: fix accounting mdbx_ovpage_free(). 2018-09-13 17:19:06 +03:00
Leo Yuriev
6ce08100fa mdbx: fix accounting mdbx_page_loose(). 2018-09-13 16:52:12 +03:00
Leonid Yuriev
c3a9ad52ed mdbx: fix accounting mdbx_page_new().
Change-Id: I635c4f4dedeb03ef7011a7c1516c53a446416901
2018-09-13 16:50:52 +03:00
Leo Yuriev
7c5d24f99a mdbx: fix accounting mdbx_rebalance(). 2018-09-13 16:49:25 +03:00
Leo Yuriev
3a8d73b7ef mdbx: fix accounting mdbx_drop0(). 2018-09-13 16:47:25 +03:00
Leo Yuriev
5c06a4c917 mdbx: add mdbx_outer_db(). 2018-09-13 16:46:16 +03:00
Leonid Yuriev
02f3230e0c mdbx: rework cursor's couple (required for further fixing).
Change-Id: Ic89c59eaea36d14a26e29d2012c693d92474a748
2018-09-13 16:38:43 +03:00
Leo Yuriev
e25b30b5ce mdbx: add mdbx_page_befree(). 2018-09-13 16:25:46 +03:00
Leonid Yuriev
676fc941f1 mdbx: fix accounting mdbx_cursor_del().
Change-Id: I19418e46ac1c692aa4eb346019c3a11539870f94
2018-09-13 16:23:33 +03:00
Leonid Yuriev
f62bb4b6a7 mdbx: fix accounting mdbx_cursor_put().
Change-Id: I7e621d62104d2d4e1c8cabf479077369d566f135
2018-09-13 16:22:03 +03:00
Leo Yuriev
e7da946fac mdbx: reset length of PNL before shrinking. 2018-09-13 16:04:32 +03:00
Leo Yuriev
7498286e3a mdbx: verification of in-db stats. 2018-09-13 16:04:28 +03:00
Leo Yuriev
3bc339ef19 mdbx: enumeration for page types. 2018-09-13 16:00:33 +03:00
Leo Yuriev
3a2ea85c79 mdbx: alter cursor flags.
Change-Id: Icab3ca150b2c2cb003dbedb24024fe142c540082
2018-09-13 15:43:08 +03:00
Leo Yuriev
e9d63315d1 mdbx-chk: refine dbi-structure. 2018-09-13 01:10:52 +03:00
Leonid Yuriev
073ee8888c mdbx-tools: add/fix printf-format checking.
Change-Id: I8d6f5c66ad7ff51296e415bfe577d99823743c56
2018-09-13 01:10:41 +03:00
Leo Yuriev
ceac458b4e mdbx: rework internal self-audit.
Change-Id: I42a585a61a9040a24d9d8dbd12fe9055d189195c
2018-09-13 00:52:57 +03:00
Leo Yuriev
20022658be mdbx-tools: remove "" from printf-strings. 2018-09-13 00:52:56 +03:00
Leo Yuriev
3c87e02716 mdbx: add unlikely for comparison result inside mdbx_cursor_set(). 2018-09-12 19:51:05 +03:00
Leonid Yuriev
51b89c9690 mdbx: fix memleak after midl2 rework.
Change-Id: I211a1c0e2b7e0c5abc44ff82151f83f81ddda754
2018-09-12 19:51:05 +03:00
Leonid Yuriev
ee21afce1e mdbx: fix comments typo.
Change-Id: Ieb8ee5d6d76457efbd54958fe9d894f752880520
2018-09-12 19:51:05 +03:00
Leo Yuriev
8966a1773c mdbx: add C_GCFREEZE cursor's flag.
Change-Id: I813a2c2ac30564d8943f0cf50a601b858dda0bd9
2018-09-12 19:51:05 +03:00
Leonid Yuriev
f373a0ca84 mdbx: rework/speedup filtering of dirty-list from loose-pages inside mdbx_update_gc().
Change-Id: Icf4101fa77314ab79be90ee429cf2df639686d7e
2018-09-12 19:48:06 +03:00
Leonid Yuriev
8abff4773f mdbx: rework ID2L.
Change-Id: Ia5b47bcceb176c994bfe59373242f8622389697e
2018-09-12 19:29:25 +03:00
Leonid Yuriev
25fc9305dd mdbx: add MDBX_WORDBITS, update MAX_PAGENO.
Change-Id: Ibb0425cee9fd2870298e25f82ab094e57ac63f96
2018-09-12 19:28:51 +03:00
Leonid Yuriev
93a71c29e7 mdbx: add mdbx_mid2l_sort().
Change-Id: Ib70a46063611b0657b34524d268b2ee5bd9b1eb8
2018-09-12 19:27:23 +03:00
Leonid Yuriev
30b084724a mdbx: setup mdbx_cmp_memn() as data-comparator for safety. 2018-09-12 19:25:12 +03:00
Leonid Yuriev
e3ff19a722 mdbx: check comparator for MDBX_GET_BOTH and MDBX_GET_BOTH_RANGE. 2018-09-12 19:24:34 +03:00
Leo Yuriev
f58185afa6 mdbx: don't touch mm_psize and mm_flags while provoking bad readers (debug-only). 2018-09-12 19:23:56 +03:00
Leo Yuriev
8364427d02 mdbx: fix concurrent opening with custom pagesize (get pagesize from meta-page early). 2018-09-12 19:22:53 +03:00
Leonid Yuriev
15a9fb9b98 mdbx-tools: refine 'mismatch idl length' error message.
Change-Id: I64ed835035f2318b295353f9360fc4d4da2afa28
2018-08-23 14:48:20 +03:00
Leo Yuriev
c362ad9465 mdbx: fix added limit's API. 2018-08-22 16:19:42 +03:00
Leonid Yuriev
8acc1979bb mdbx: fix mdbx_env_get_maxkeysize() result type (minor).
Change-Id: I8e3a7f8c2b81b5f8ac40801313cbd6f17d2dea64
2018-08-21 22:35:53 +03:00
Leonid Yuriev
f371f10743 mdbx: one more fix/rewrite mdbx_update_gc().
Change-Id: I7188f1566488d239d018311286612c3117f58127
2018-08-21 22:19:20 +03:00
Leonid Yuriev
7aab221bf4 mdbx: add mdbx_txl_sort().
Change-Id: Idffb3b4a3fa455d125559a36cbe7c88b8a848b02
2018-08-21 22:19:20 +03:00
Leonid Yuriev
a0d10e41b8 mdbx: add mdbx_limits_xyz().
Change-Id: I56c79704c59386a0c4d84b001020484c23925e6c
2018-08-21 22:19:20 +03:00
Leonid Yuriev
08fa2c1746 mdbx: drop/replace PNL-constant with MDBX_LIST_MAX.
Change-Id: I71722f06c771ad57e3e7ca84f3d497750cae8419
2018-08-21 22:19:20 +03:00
Leonid Yuriev
0797ae2270 mdbx: set basic size of PN-lists to 2^24 for large TXN.
Change-Id: I6bc293d8940166da7df0a291fed8b5db794db9b9
2018-08-21 22:19:20 +03:00
Leonid Yuriev
0f63ab0385 mdbx: refine PN-lists.
Change-Id: Ib5ffafe634993b6f3b0fb7e35cc49f7d9b8c95a5
2018-08-21 22:19:20 +03:00
Leonid Yuriev
cb081424ff mdbx: don't keep extra space while update on overflow-pages.
Change-Id: I70f2a87e0e9ec088f692021cfcfcd1b81f287e31
2018-08-21 22:19:20 +03:00
Leonid Yuriev
d3e9626a15 mdbx: fix mdbx_pnl_grow().
Change-Id: I414501381a0ffea91677d8e5ef696fa6f645001f
2018-08-21 22:19:20 +03:00
Leonid Yuriev
434f0d5b57 mdbx: fix/rewrite mdbx_update_gc().
Change-Id: I580a1ff0cbeeb529e2bcbd50d97bfba7bcf5a546
2018-08-13 01:21:07 +03:00
Leonid Yuriev
c43b7d1aba mdbx-test: fix minor typos.
Change-Id: I4889a0e698bdfdda7eed257a5cd29e8b8089d102
2018-08-13 01:21:07 +03:00
Leonid Yuriev
111befb695 mdbx: refine befree-store inside freelist_save(). 2018-08-12 21:19:18 +03:00
Leonid Yuriev
559e7bc8de mdbx: fix MDBX_EKEYMISMATCH while update multi-value with MDBX_CURRENT. 2018-08-10 18:39:19 +03:00
Leonid Yuriev
1d716c043d mdbx: fix assertions. 2018-08-10 18:33:59 +03:00
Leonid Yuriev
bc45eb30fb mdbx: add checking result from mid2l-functions.
Change-Id: I8c2b4110c335b5632e4c71d6b8304f3ab437696e
2018-08-10 12:32:02 +03:00
Leonid Yuriev
c472300b13 mdbx: add MDBX_PNL_MAX and checking size of lists.
Change-Id: I32e31d2caf676e1e96cc4f82610544b5c5ee3a6d
2018-08-10 12:31:29 +03:00
Leonid Yuriev
b4fd29a67b mdbx: fix assert-condition inside mdbx_pnl_xappend().
Change-Id: Id5ac89c85b7e673c44d60a626c805fe666d221bc
2018-08-10 09:36:03 +03:00
Leo Yuriev
e0fcd6e0ec mdbx: add PTHREAD_MUTEX_ERRORCHECK for shared mutexes.
Change-Id: Ib9520b6bc68b294088298b1901278fab824ea43e
2018-08-02 18:36:45 +03:00
Leo Yuriev
6a51343b89 mdbx: fix 'db_dummy' inside mdbx_dbi_open_ex().
Change-Id: I70a21c9b77a43c5af749da5723fa965487a056b0
2018-08-02 11:14:46 +03:00
Leo Yuriev
d72ba6fd69 mdbx: fix Coverity warning (minor). 2018-08-01 21:31:56 +03:00
Leo Yuriev
275b80e086 mdbx: fix mdbx_page_get().
Fix commit 32c63077a4
Change-Id: I7649c3c65c19013e1b367e7554fbe823ea0511d2
2018-08-01 20:45:49 +03:00
Leo Yuriev
cb70cb18fc mdbx: use 'short' for lck-type (minor). 2018-08-01 18:31:09 +03:00
Leo Yuriev
5ed725dc29 mdbx: minor refine mdbx_txn_renew0(). 2018-08-01 18:31:09 +03:00
Leo Yuriev
e06ab1d2a5 mdbx: explicit call mdbx_rpid_clear(). 2018-08-01 18:31:09 +03:00
Leo Yuriev
ac54a3959d mdbx: add fallback2shared for mdbx_lck_exclusive(). 2018-08-01 18:31:09 +03:00
Leo Yuriev
5a1f388db5 mdbx: drop unused mdbx_lck_upgrade(). 2018-08-01 18:16:40 +03:00
Leo Yuriev
dbf66ec0bb mdbx: add __printf_args into defs.h
Change-Id: I0e6da5115bc427d04eb3ab59184152275c2a7cae
2018-07-28 17:59:56 +03:00
Leo Yuriev
32c63077a4 mdbx: check page bound inside mdbx_page_get().
Change-Id: I7649c3c65c19013e1b367e7554fbe823ea0511d2
2018-07-25 11:36:17 +03:00
Leo Yuriev
21858201e0 mdbx: fix nasty suspend_and_append() bug.
Change-Id: I043adcff2e6c040426a51b5d4b15bac849e6dd9f
2018-07-24 00:18:47 +03:00
Leo Yuriev
dfea68270a mdbx: fix assertion inside mdbx_suspend_threads_before_remap().
Change-Id: If01fc5f655922c55b3955f2b00c93b80328c5232
2018-07-19 08:48:50 +03:00
Leo Yuriev
f425e98eb5 mdbx: fix mdbx_env_compact().
Change-Id: Ie269b45c3d0325cb1b2d82f4ed1c18f8b3fe4212
2018-07-06 15:25:14 +03:00
Leo Yuriev
20a61f273c mdbx: set MDBX_FATAL_ERROR when mdbx_env_open() failed.
Change-Id: If02d670c7ce3a5dd696a87848df28ffe817c6922
2018-07-06 15:08:33 +03:00
Leo Yuriev
8e0f5bea4a mdbx: minor fix to avoid Valgrind false-positive issue.
Change-Id: Ifa4dc51b500ff42a88182d750e22572aa5b2155b
2018-07-01 17:42:35 +03:00
Leo Yuriev
c9d0c8edeb mdbx: create new files with mode=0640 inside mdbx_env_copy().
Change-Id: I468f0fa29d471a2e877ea20a5e61f6358347c6eb
2018-06-30 14:56:28 +03:00
Leo Yuriev
e57d4bbb00 mdbx: remove created file if mdbx_env_copy() failed.
Change-Id: Ie47981b6031c6e7099a5d49f6cd7338ab2c1e040
2018-06-30 14:56:28 +03:00
Leo Yuriev
797bcf9aca mdbx: add mdbx_removefile().
Change-Id: I985926bdef28387d5872317a3ecf47953ce4812c
2018-06-30 14:56:28 +03:00
Leo Yuriev
ba1387b791 mdbX: add few __cold (minor).
Change-Id: I8b99ea4f3829c6b08355cc8de0a11962756370af
2018-06-30 14:18:36 +03:00
Leo Yuriev
d90e6187f7 mdbx: support exclusive mode without lck-file.
Change-Id: I1beef09d62965d0d777f579a8aa6f15c478eebd2
2018-06-30 14:15:24 +03:00
Leo Yuriev
9e81d5b631 mdbx: allow mdbx_env_compact() to fix page leaks.
Don't treat fixing page leaks as an error while copy DB with compactification.

Change-Id: I2a575ff9e2b24610172aaca939b5f6957c26ec77
2018-06-30 01:35:27 +03:00
Leo Yuriev
639e639fa3 mdbx_chk: fix GC check for MDBX_EXCLUSIVE/MDBX_RDONLY modes.
Change-Id: I40c8f8321791d0c6ddcbbfcf67f2903347d90f17
2018-06-30 00:33:22 +03:00
Leo Yuriev
f4a01da47f mdbx: avoid weak meta inside mdbx_init_metas().
Change-Id: Ib9c5ab04ad8cff3ad43d94a288cecec45d7ef37d
2018-06-30 00:03:15 +03:00
Leo Yuriev
b9d3eac12e mdbx: minor refine mdbx_env_copy().
Change-Id: I007add822bc4d30b7a8a838981ada6d2812f669a
2018-06-29 23:54:59 +03:00
Leo Yuriev
bc77ab3cca mdbx: refine Coverity warning fix.
Change-Id: I6bbb791f32a6b64712e88e0b2dd87052e353c730
2018-06-21 18:28:30 +03:00
Leo Yuriev
31b5f64054 mdbx: bump version to v0.2.0
Change-Id: I113419b685c38f23c35da6790648f7f994a15f29
2018-06-21 17:54:59 +03:00
Leo Yuriev
9b39b959de mdbx: cleanup formating (cosmetic).
Change-Id: I4a502fa8e43b9556318628bef05447567e5a98be
2018-06-21 17:28:42 +03:00
Leo Yuriev
40ec114048 mdbx: fix Coverity warning (minor, paranoia).
Change-Id: I232377a03244dc33beb4f332c0024b454027f659
2018-06-21 17:28:01 +03:00
Leonid Yuriev
b57c3b2503 mdbx: check for non-local files in non-exclusive mode.
Change-Id: Ibd1bbf48aba42d5ed736069d59b18ac0dd143554
2018-06-20 13:52:08 +03:00
Leonid Yuriev
f625b6cb42 mdbx: restore env-flags when env_open() failed.
Change-Id: I597b242c6f56c16dfef0a3d34c2113f71908cef4
2018-06-20 13:52:08 +03:00
Leo Yuriev
0dfa9cd09a mdbx: add MDBX_EXCLUSIVE instead of mdbx_env_open_ex().
Change-Id: I3c817d58d971385bcd07643df14beaf7122c7836
2018-06-20 13:52:02 +03:00
Leo Yuriev
09ad941a05 mdbx: Windows XP compatibility.
Change-Id: Iafe3a83110610071e42a168ef9fc5f8d3131854f
2018-06-20 13:47:14 +03:00
Leo Yuriev
28eda32c12 mdbx: split-out mdbx_is_file_local().
Change-Id: Ib7d990c4ce19d9b14a4b6739ca321d9d2666c882
2018-06-20 13:47:14 +03:00
Leonid Yuriev
fc41cd64d1 mdbx: add MDBX_CONFIG_MANUAL_TLS_CALLBACK.
Change-Id: I3ed60348f532cc9206f9ec0e7c1d3428b4f037a2
2018-06-20 13:47:14 +03:00
Leo Yuriev
9f2bf6a377 mdbx: provide SRWL stub for Windows XP/2000.
Change-Id: I438373a4952298efc88ca4c1a92c88e173b82f98
2018-06-20 13:47:14 +03:00
Leo Yuriev
685abc7bcb mdbx: more/again reformat by clang-format 6.0 (cosmetic).
Change-Id: I769ee5a80d75a49fc5bb041fefda6f22adc05424
2018-06-20 13:45:11 +03:00
Leo Yuriev
9db090087e mdbx: reformat by clang-format 6.0 (cosmetic). 2018-06-18 21:29:12 +03:00
Leo Yuriev
93e3b4129a mdbx-tools: fix wrong 'bad sequence' error from mdbx_stat. 2018-06-18 16:36:53 +03:00
Leo Yuriev
f314cd6b92 mdbx: windows - fix truncation race while unmap.
Change-Id: I93983d100c78aa3e57c5a7ebd9d5bf2a96081ed7
2018-06-15 02:54:41 +03:00
Leo Yuriev
b6e605b8da mdbx: bump version to v0.1.5 2018-06-14 13:53:05 +03:00
Leo Yuriev
2f983b281d mdbx: drop MDBX_DEVEL.
Change-Id: I5fc1a240e7909b8ecaf2ef19a83a9e59ea5609ba
2018-06-13 11:37:56 +03:00
Leo Yuriev
efdcbd8c35 mdbx: disable non-blocking DB-close under Windows.
Change-Id: If6579467132439b6b627e756f67f6bd35fed8b4f
2018-06-13 02:46:18 +03:00
Leo Yuriev
634efbe34b mdbx: don't block close_env() if other write-txn running.
Change-Id: I1d19afcc245578681b8bc3ee3966ac38bc596ec4
2018-06-12 13:18:17 +03:00
Leo Yuriev
fdc248384e mdbx: skip meta if usedbytes beyond oef.
Change-Id: I1e95136bce7169b7ed612f9746d0cdec43caca14
2018-06-01 13:27:20 +03:00
Leo Yuriev
38369bd24b mdbx: force steady-sync when shrinking DB (fix corruption bug).
Change-Id: I636ee2ad04f28d4038d74bdf2c7061ab885f4b82
2018-06-01 13:15:21 +03:00
Leo Yuriev
ab4c9c9db0 mdbx: return MDBX_CORRUPTED instead of crash if MDBX_DUPSORT mismatch.
Change-Id: I439a3c859dbfcfbe33a3db077c3e8200a1417c31
2018-05-28 20:04:48 +03:00
Leo Yuriev
e86bd88751 mdbx: disable warning #5045 for MSVC (minor). 2018-05-21 16:31:36 +03:00
Leo Yuriev
bea1349dd4 mdbx: bump internal version info to v0.1.4 2018-05-04 13:21:18 +03:00
Leo Yuriev
d0ddc8569b mdbx-windows: fix lck_reader_alive_check().
Change-Id: Icbc54d9b3003f70bba573a3807c5161380339460
2018-05-04 02:17:21 +03:00
Leo Yuriev
f1edd1579a mdbx: fix wrong freeDB search.
Avoid search freeDB while tree is updating.

This resolves https://github.com/leo-yuriev/libmdbx/issues/31
Bug was inherited from LMDB.

Change-Id: I0b12f8d9b88bca5aa26ca27db81df9b72c6a19b7
2018-04-25 03:01:12 +03:00
Leo Yuriev
d127c28e83 mdbx-windows: fix srw-release if rdt-lock failed (minor/paranoia). 2018-04-12 00:56:58 +03:00
Leo Yuriev
159d676429 mdbx: fix typo in mdbx_chk output. 2018-04-10 21:12:41 +03:00
Leo Yuriev
f4a9018690 mdbx: bump internal version info to v0.1.3
Change-Id: I7db311c812d531f6628101715f6658005db3ea24
2018-04-03 20:37:07 +03:00
Leo Yuriev
797ae9d1db mdbx: minor fix debug-output for mdbx_thread_key_create().
Change-Id: I718130cf2385b6221187cbcdeedd9d48d05289bb
2018-04-03 20:04:10 +03:00
Leo Yuriev
864be54f01 mdbx: fix/rework rthc counting.
Change-Id: I97fd5bd6dc1a46658138d82db10e937c9595d81f
2018-04-03 19:28:12 +03:00
Leo Yuriev
571b50622e mdbx: restore workaround for glibc's bug #21031.
Workaround for https://sourceware.org/bugzilla/show_bug.cgi?id=21031

Change-Id: I6cf9e037cc2fc298096b78ec96773f19478ed5c0
2018-04-03 17:44:18 +03:00
Leo Yuriev
36a86bbc6e mdbx: fix cursor tracking inside mdbx_rebalance(). 2018-03-26 20:20:14 +03:00
Leo Yuriev
02fc5fe158 mdbx: update internal version info. 2018-03-23 17:23:28 +03:00
Leo Yuriev
45f159ddd3 mdbx: mdbx_cursor_put(MDBX_APPEND+MDBX_NOOVERWRITE) should return MDBX_KEYEXIST instead of MDBX_EKEYMISMATCH.
When MDBX_APPEND is used the ordering of keys is important.
Therefore MDBX_EKEYMISMATCH should me returned when given key <= last.

On the other hand, if MDBX_NOOVERWRITE is also used
then the MDBX_KEYEXIST should be returned, but not MDBX_EKEYMISMATCH.
2018-03-23 17:21:27 +03:00
Leo Yuriev
6758348046 mdbx: import intrin-includes from t1ha. 2018-03-22 21:11:26 +03:00
Leo Yuriev
61a2c56784 mdbx: fix/rework cache-line alignment. 2018-03-22 21:11:26 +03:00
Leo Yuriev
6a074cb85a mdbx: fix unaligned access to mp_ptrs[] on fake-page.
Based on http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=commitdiff;h=e77918a903d980ff789b7e32f71725481e870510
2018-03-22 21:11:26 +03:00
Leo Yuriev
dbc87a8a5e mdbx: refine MDBX_CACHE_IS_COHERENT. 2018-03-22 20:38:20 +03:00
Leo Yuriev
c52a57dac5 mdbx: fix for MIPS cacheflush(). 2018-03-22 20:37:50 +03:00
Leo Yuriev
5ce40269b3 mdbx: fix gcc warning (minor). 2018-03-22 20:37:50 +03:00
Leo Yuriev
86274513f9 mdbx: more __has_include(). 2018-03-21 22:19:17 +03:00
Leo Yuriev
f5571e4027 mdbx: import byte-order macros from t1ha. 2018-03-21 22:19:17 +03:00
Leo Yuriev
62ae928b40 mdbx: add neutral __ia32__ and __amd64__ marcos. 2018-03-21 22:18:57 +03:00
Leo Yuriev
a282965aa0 mdbx: add check __ALIGNED__ for UNALIGNED_OK macro. 2018-03-21 21:10:57 +03:00
Leo Yuriev
475da5bcfe mdbx: make mdbx_txn_lock() and mdbx_txn_unlock() exportable for mdbx_chk. 2018-03-20 22:19:32 +03:00
Leo Yuriev
679fb56787 mdbx: lookup suitable txnid for rollback to avoid meta-pages clashes. 2018-03-20 22:16:15 +03:00
Leo Yuriev
dd6cb30820 mdbx-chk: directly use mdbx_txn_lock() for write/recovery mode. 2018-03-20 21:37:42 +03:00
Leo Yuriev
e8dd15088a mdbx: add __ARM_FEATURE_UNALIGNED __e2k__ for UNALIGNED_OK. 2018-03-19 19:59:00 +03:00
Leo Yuriev
d0e1c02a8a mdbx-chk: rework/fix read-write mode. 2018-03-19 18:08:45 +03:00
Leo Yuriev
a2ec7f2be1 mdbx: add mdbx_txn_flags(). 2018-03-19 18:08:45 +03:00
Leo Yuriev
64613c9061 mdbx: fix minor memleak (Coverity). 2018-03-19 16:16:31 +03:00
Leo Yuriev
c05d179035 mdbx: temporary workaround for Elbrus's libc bug.
https://bugs.mcst.ru/bugzilla/show_bug.cgi?id=2820
2018-03-19 15:05:56 +03:00
Leo Yuriev
195b53374e mdbx: fix #pragma pack(pop) balance.
Thanks to <Sergey.V.Barannikov@mcst.ru>.
2018-03-14 16:05:43 +03:00
Leo Yuriev
f521b6615e mdbx: fix #endif's comment (cosmetics). 2018-03-14 15:32:32 +03:00
Leo Yuriev
9bbc62f5a0 mdbx: refine internal warnings control. 2018-03-14 15:16:49 +03:00
Leo Yuriev
8c96b1e73b mdbx: fix missing MDBX_DEVEL=0. 2018-03-14 15:07:16 +03:00
Leo Yuriev
483c4abb3f mdbx: remove Elbrus's alignment_reduction_ignored workaround. 2018-03-14 14:57:46 +03:00
Leo Yuriev
c267a71475 mdbx: workaround for "alignment-reduction-ignored" lcc's bug.
Change-Id: I000bfaffd78ef7b6e27d6178bc2a5defc32cc357
2018-03-07 13:59:51 +03:00
Leo Yuriev
a2099586ed mdbx: disable -Wno-constant-logical-operand inplace.
Change-Id: I0f7745f40e3340ba6d14d985a735777667a7bdde
2018-03-07 13:18:30 +03:00
Leo Yuriev
f76c5188fb mdbx: add stubs for __has_warning and __has_include.
Change-Id: Ic037a38d254e6d986b84a5bfd48106e43cf80320
2018-03-07 13:07:17 +03:00
Leo Yuriev
62603aeadc mdbx: add ifdef-guard for clang < 3.8
Change-Id: Iba7a90e2548056cbdf07ae471eb002da7145821c
2018-03-07 13:06:39 +03:00
Leo Yuriev
62f36ea499 mdbx: bump version to 0.1
Change-Id: I31cdcd598c532d1dd96a4aea961495c838ce0b81
2018-03-07 12:25:35 +03:00
Leo Yuriev
ad4c5d8972 mdbx: add __cold/__hot for Elbrus. 2018-03-07 12:24:32 +03:00
Leo Yuriev
a93fafceff mdbx: strip utf8-bom for Elbrus (minor).
Change-Id: I9030abe267c4abfa2c5c2deb439c0b8025b83047
2018-03-07 12:09:43 +03:00
Leo Yuriev
260c1d71dd mdbx: add self_latter_reader_txnid into MDBX_envinfo.
Change-Id: I17ac6e921f99df6ed61096ff0fbfbacf5a7e4608
2018-02-04 17:13:27 +03:00
Leo Yuriev
72557af2b5 mdbx: HNY!
Change-Id: I2a91b986964d96bb3e5f848e3c17408bd7745866
2018-02-04 13:10:54 +03:00
Leo Yuriev
6a0ff097ee mdbx: immediately share dbi-handles for present TBLs (major).
Change-Id: I75c998e06b3ccc25bd22ef389d119052d524d70b
2018-02-04 12:59:47 +03:00
Leo Yuriev
e8ae506773 mdbx: minor refine env-init. 2018-02-02 19:06:14 +03:00
Leo Yuriev
7b59452aed mdbx: less memset overhead while txn-init. 2018-02-02 19:05:41 +03:00
Leo Yuriev
5db134c816 mdbx: minor refine defs. 2018-02-02 19:04:33 +03:00
Leo Yuriev
5cfec7a832 mdbx: workaround for Windows LockFileEx/WriteFile bug.
This resolves https://github.com/leo-yuriev/libmdbx/issues/25
2018-01-31 15:26:44 +03:00
Leo Yuriev
5c9baa06b9 mdbx: fix mdbx_txn_end() assert for mt_owner. 2018-01-30 19:52:39 +03:00
Leo Yuriev
1143390e58 mdbx: fix/allow mdbx_txn_end() to re-aborting txn. 2018-01-24 18:45:42 +03:00
Leo Yuriev
ca06c1973e mdbx: fix/allow mdbx_txn_renew() after an renew-error. 2018-01-24 17:40:57 +03:00
Leo Yuriev
a45612e6d0 mdbx: fix lower_size overwrite.
Change-Id: If9addb1f549628866e3ce9597f1a542684ef8f2d
2018-01-14 22:40:11 +03:00
Leo Yuriev
ab7cb2c39e mdbx-build: minor cleanup after pul-request/merge.
Change-Id: Ia612dbd939be7acd938fca8eb3f93f650560417a
2018-01-14 22:09:52 +03:00
Leonid Yuriev
506caee9e5
mdbx-buiid: Merge pull request #21 from vvromanov/master
Add CMake build files and rpm generation.
2018-01-14 21:42:34 +03:00
Leonid Yuriev
8d4b6b187f mdbx-windows: resize file on umnap.
Change-Id: Ia4739bfcd2cc7b91c14e294c7569cbee582165b1
2018-01-14 21:16:52 +03:00
Leo Yuriev
5acf93c54d mdbx: rework allowing open large DB from a 32-bit environment.
Change-Id: Id7d9e2041158d0715496b852a5ddb297bde1495e
2018-01-14 21:16:52 +03:00
Leo Yuriev
915830d0d3 mdbx: fix mapsize_min typo inside mdbx_read_header().
Change-Id: I65ffebb37f1332832a0e17796ba184be5d3fc929
2018-01-14 21:16:52 +03:00
Leo Yuriev
c2fe0a71bc mdbx-windows: reserve address space to avoid occupy it by other threads.
Change-Id: Ia5caec6bbeb55c7894de70e349e6e9479572b688
2018-01-14 21:16:52 +03:00
Leonid Yuriev
5c058287d5 mdbx-windows: check ability of address space for growth before umnap.
Change-Id: Ibb62dae26ebab8f3efdbf6aed1b26d88ed63a2b7
2018-01-14 21:16:52 +03:00
Leonid Yuriev
373d4ad81d mdbx: allowing open large DB from a 32-bit environment. 2018-01-14 15:39:11 +03:00
Leo Yuriev
8a08df9188 mdbx: check txn inside mdbx_cursor_renew().
Change-Id: I444ff36739d875dda835e8ded7a7aae37c8bd2be
2018-01-11 21:49:29 +03:00
Leo Yuriev
c4007cbc70 mdbx: check txn inside mdbx_cursor_txn().
Change-Id: Ia3d24800890369e3b6cab23d8f69c27246a4f017
2018-01-11 21:48:47 +03:00
Leo Yuriev
6b5533338f mdbx: prohibit recursive txn-begin by MDBX_BUSY.
Change-Id: I46f5159cec72df9c8aece07fbfb462682499a272
2018-01-11 21:15:33 +03:00
Leo Yuriev
18432ebfab mdbx-windows: minor refine LCK_BODY_LEN.
Change-Id: Id02434a12ba66f15b2aa624819c068f6e6fce0d3
2018-01-10 01:02:23 +03:00
Leo Yuriev
455f60eec1 mdbx: minor fix OSAL (extra assert).
Change-Id: I2caad4a9c4638f124a2bae534bff4d9ed7b57f30
2018-01-10 01:01:49 +03:00
Leo Yuriev
abcacea543 mdbx: more pid and MDBX_FATAL_ERROR checks.
Change-Id: Ifa223f270312cb7bbba01bdb76173f8230efb91b
2018-01-09 21:14:42 +03:00
Leo Yuriev
c0be0d6fb7 mdbx: fix mdbx_env_set_geometry() for case remap failed.
Change-Id: I0850692737eaee3c7f33194dfa19b88ce74497c8
2018-01-09 21:13:04 +03:00
Leo Yuriev
8e8c00aadf mdbx-windows: raise MDBX_PANIC if remap failed. 2018-01-09 15:46:42 +03:00
Leo Yuriev
963da34412 mdbx: fix mdbx_env_set_geometry(). 2018-01-09 15:38:03 +03:00
Leo Yuriev
e7922b65fa mdbx-windows: refine mdbx_mresize(). 2018-01-09 15:37:52 +03:00
Leo Yuriev
59ad929d36 mdbx-windows: fix and refine mdbx_suspend_threads_before_remap().
Change-Id: I4f289f5d603ca18e6714455604dd4ce98931af41
2018-01-08 18:19:25 +03:00
Leo Yuriev
30bd7d3078 mdbx: shrinking memory-mapping for Windows (initial).
Change-Id: I3c3c2df0747c788ea36d7764c1e8139098ca62be
2018-01-08 17:47:41 +03:00
Leo Yuriev
f10f5b376f mdbx: account freelist-backlog while shrinking DB.
Change-Id: I8b211f281483e7cb6344ef99c571f3516d16f61d
2018-01-07 22:31:34 +03:00
Leonid Yuriev
7812476518 mdbx: fix readonly mapping for Windows.
Change-Id: Ie301d7af74ff91e802aa78af8cfb329f587137ee
2018-01-07 17:08:47 +03:00
Vladimir Romanov
4ed8eddf42 Improve cmake support. Add rpm generation 2018-01-07 15:10:06 +03:00
Leonid Yuriev
d14ca5cc4f mdbx: fix _InterlockedExchangeAdd64 for some 32-bit SDKs.
Change-Id: I18280e8ef6432b9db3c5073fd59eaa102462f98d
2018-01-07 14:35:47 +03:00
Leo Yuriev
897d4dbf87 mdbx: fix growth memory-mapping on Windows.
This resolves https://github.com/leo-yuriev/libmdbx/issues/22

Change-Id: I25c2e65d9f68da8012ee097d3ad579cd548f2e09
2018-01-07 14:31:29 +03:00
Leo Yuriev
91a9d4d916 mdbx: more ntpapi for Windows.
Change-Id: I616b09502302be9e3017db7e99cf4dcf8697f32f
2018-01-07 14:22:17 +03:00
Vladimir Romanov
18a261a6dd Add CMake support 2018-01-04 09:27:09 +03:00
Leo Yuriev
24a8bdec49 mdbx: fix SIGSEGV in case mdbx_env_close_ex() called without mdbx_env_open(). 2017-12-20 14:22:55 +03:00
Leo Yuriev
3e9308eb0e mdbx: check for running write-txn inside mdbx_env_close(). 2017-12-19 16:38:21 +03:00
Leo Yuriev
b1c7fa30c0 mdbx: fix MDBX_BUSY comment/description (typo). 2017-12-19 16:37:20 +03:00