From 49fa9b9c35a25e11de6feda82b336ad1aa516102 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Mon, 4 Feb 2019 00:08:56 +0300 Subject: [PATCH] mdbx: fix handling MDBX_APPENDDUP mode. Change-Id: I36de2a8dcab5126dab3857a7840ab3904a1d19c8 --- src/mdbx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mdbx.c b/src/mdbx.c index 486ff754..9ccdb8aa 100644 --- a/src/mdbx.c +++ b/src/mdbx.c @@ -8300,7 +8300,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; }