diff --git a/src/mdbx.c b/src/mdbx.c index 0f1d89c5..cd81e361 100644 --- a/src/mdbx.c +++ b/src/mdbx.c @@ -7699,7 +7699,7 @@ int mdbx_cursor_put(MDBX_cursor *mc, MDBX_val *key, MDBX_val *data, if (rc > 0) { rc = MDBX_NOTFOUND; mc->mc_ki[mc->mc_top]++; - } else { + } else if (unlikely(rc < 0 || (flags & MDBX_APPENDDUP) == 0)) { /* new key is <= last key */ rc = MDBX_EKEYMISMATCH; }