From ded1ada9eb7bffbc17d809d4428c7359f3096fae Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Tue, 16 Feb 2016 23:34:27 +0000 Subject: [PATCH] mdbx: backport - Tweak MDB_PREV_MULTIPLE for uninit'd cursor. Change-Id: I1f07e7c4d80631a1a0b2c70a936ef7b458baa11a --- mdb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mdb.c b/mdb.c index df090223..6ac1a862 100644 --- a/mdb.c +++ b/mdb.c @@ -6420,8 +6420,10 @@ fetchm: break; } if (!(mc->mc_flags & C_INITIALIZED)) - rc = mdb_cursor_first(mc, key, data); - else { + rc = mdb_cursor_last(mc, key, data); + else + rc = MDB_SUCCESS; + if (rc == MDB_SUCCESS) { MDB_cursor *mx = &mc->mc_xcursor->mx_cursor; if (mx->mc_flags & C_INITIALIZED) { rc = mdb_cursor_sibling(mx, 0);