mirror of
https://github.com/isar/libmdbx.git
synced 2024-12-30 01:34:14 +08:00
mdbx: не трогать LRU и dbi в cursor_touch() для вложенных курсоров.
This commit is contained in:
parent
0941319940
commit
61d21b0a02
20
src/core.c
20
src/core.c
@ -16909,22 +16909,22 @@ static int touch_dbi(MDBX_cursor *mc) {
|
||||
return MDBX_SUCCESS;
|
||||
}
|
||||
|
||||
static int cursor_touch(MDBX_cursor *const mc, const MDBX_val *key,
|
||||
const MDBX_val *data) {
|
||||
static __hot int cursor_touch(MDBX_cursor *const mc, const MDBX_val *key,
|
||||
const MDBX_val *data) {
|
||||
cASSERT(mc, (mc->mc_txn->mt_flags & MDBX_TXN_RDONLY) == 0);
|
||||
cASSERT(mc, (mc->mc_flags & C_INITIALIZED) || mc->mc_snum == 0);
|
||||
cASSERT(mc, cursor_is_tracked(mc));
|
||||
|
||||
txn_lru_turn(mc->mc_txn);
|
||||
|
||||
if (unlikely((*mc->mc_dbistate & DBI_DIRTY) == 0)) {
|
||||
int err = touch_dbi(mc);
|
||||
if (unlikely(err != MDBX_SUCCESS))
|
||||
return err;
|
||||
}
|
||||
|
||||
if ((mc->mc_flags & C_SUB) == 0) {
|
||||
MDBX_txn *const txn = mc->mc_txn;
|
||||
txn_lru_turn(txn);
|
||||
|
||||
if (unlikely((*mc->mc_dbistate & DBI_DIRTY) == 0)) {
|
||||
int err = touch_dbi(mc);
|
||||
if (unlikely(err != MDBX_SUCCESS))
|
||||
return err;
|
||||
}
|
||||
|
||||
/* Estimate how much space this operation will take: */
|
||||
/* 1) Max b-tree height, reasonable enough with including dups' sub-tree */
|
||||
size_t need = CURSOR_STACK + 3;
|
||||
|
Loading…
x
Reference in New Issue
Block a user