mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-10 17:24:14 +08:00
mdbx: backport - check comparator for MDBX_GET_BOTH and MDBX_GET_BOTH_RANGE.
This commit is contained in:
parent
34300150a1
commit
6d438605dd
@ -7130,9 +7130,11 @@ set1:
|
|||||||
MDBX_val olddata;
|
MDBX_val olddata;
|
||||||
if (unlikely((rc = mdbx_node_read(mc, leaf, &olddata)) != MDBX_SUCCESS))
|
if (unlikely((rc = mdbx_node_read(mc, leaf, &olddata)) != MDBX_SUCCESS))
|
||||||
return rc;
|
return rc;
|
||||||
|
if (unlikely(mc->mc_dbx->md_dcmp == NULL))
|
||||||
|
return MDBX_EINVAL;
|
||||||
rc = mc->mc_dbx->md_dcmp(data, &olddata);
|
rc = mc->mc_dbx->md_dcmp(data, &olddata);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
if (op == MDBX_GET_BOTH || rc > 0)
|
if (op != MDBX_GET_BOTH_RANGE || rc > 0)
|
||||||
return MDBX_NOTFOUND;
|
return MDBX_NOTFOUND;
|
||||||
rc = 0;
|
rc = 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user