mirror of
https://github.com/isar/libmdbx.git
synced 2024-12-28 03:48:49 +08:00
mdbx: исправление GET_MULTIPLE
для специальных случаев и/или одного значения.
This commit is contained in:
parent
81a8127084
commit
76c9b42e86
11
src/cursor.c
11
src/cursor.c
@ -2184,15 +2184,22 @@ __hot int cursor_ops(MDBX_cursor *mc, MDBX_val *key, MDBX_val *data,
|
||||
if (unlikely(rc != MDBX_SUCCESS))
|
||||
return rc;
|
||||
} else {
|
||||
if (unlikely(is_eof(mc) || !inner_filled(mc)))
|
||||
if (unlikely(!is_filled(mc)))
|
||||
return MDBX_ENODATA;
|
||||
cASSERT(mc, is_filled(mc));
|
||||
if (key) {
|
||||
const page_t *mp = mc->pg[mc->top];
|
||||
const node_t *node = page_node(mp, mc->ki[mc->top]);
|
||||
*key = get_key(node);
|
||||
}
|
||||
}
|
||||
cASSERT(mc, is_filled(mc));
|
||||
if (unlikely(!inner_filled(mc))) {
|
||||
if (inner_pointed(mc))
|
||||
return MDBX_ENODATA;
|
||||
const page_t *mp = mc->pg[mc->top];
|
||||
const node_t *node = page_node(mp, mc->ki[mc->top]);
|
||||
return node_read(mc, node, data, mp);
|
||||
}
|
||||
goto fetch_multiple;
|
||||
|
||||
case MDBX_NEXT_MULTIPLE:
|
||||
|
Loading…
x
Reference in New Issue
Block a user