mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-04 20:54:12 +08:00
mdbx: fix extra assertion.
Fixes https://github.com/erthink/libmdbx/issues/248.
This commit is contained in:
parent
c484a92933
commit
a899056fd1
@ -14793,6 +14793,7 @@ int mdbx_cursor_put(MDBX_cursor *mc, const MDBX_val *key, MDBX_val *data,
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
struct cursor_set_result csr =
|
struct cursor_set_result csr =
|
||||||
|
/* olddata may not be updated in case LEAF2-page of dupfixed-subDB */
|
||||||
mdbx_cursor_set(mc, (MDBX_val *)key, &olddata, MDBX_SET);
|
mdbx_cursor_set(mc, (MDBX_val *)key, &olddata, MDBX_SET);
|
||||||
rc = csr.err;
|
rc = csr.err;
|
||||||
exact = csr.exact;
|
exact = csr.exact;
|
||||||
@ -14807,7 +14808,11 @@ int mdbx_cursor_put(MDBX_cursor *mc, const MDBX_val *key, MDBX_val *data,
|
|||||||
if (unlikely(mc->mc_flags & C_SUB)) {
|
if (unlikely(mc->mc_flags & C_SUB)) {
|
||||||
/* nested subtree of DUPSORT-database with the same key,
|
/* nested subtree of DUPSORT-database with the same key,
|
||||||
* nothing to update */
|
* nothing to update */
|
||||||
mdbx_assert(env, data->iov_len == 0 && olddata.iov_len == 0);
|
mdbx_assert(env, data->iov_len == 0 &&
|
||||||
|
(olddata.iov_len == 0 ||
|
||||||
|
/* olddata may not be updated in case LEAF2-page
|
||||||
|
of dupfixed-subDB */
|
||||||
|
(mc->mc_db->md_flags & MDBX_DUPFIXED)));
|
||||||
return MDBX_SUCCESS;
|
return MDBX_SUCCESS;
|
||||||
}
|
}
|
||||||
if (unlikely(flags & MDBX_ALLDUPS) && mc->mc_xcursor &&
|
if (unlikely(flags & MDBX_ALLDUPS) && mc->mc_xcursor &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user