From: Howard Chu Date: Sun, 14 Jul 2013 15:20:18 +0000 (-0700) Subject: Fix stale sub-cursor C_INIT flag X-Git-Tag: accepted/tizen/5.0/unified/20181102.030725~608 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=56a41d87d42568328413f6e2a6197c2ae0dc67bd;p=platform%2Fupstream%2Flmdb.git Fix stale sub-cursor C_INIT flag Whenever we enter cursor_set() the sub-cursor's flag must be cleared. If the new cursor position has valid subdata it will be initialized again, if not then the sub-cursor has nothing to point to. --- diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index df88adc..3f8dc73 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -4856,6 +4856,9 @@ mdb_cursor_set(MDB_cursor *mc, MDB_val *key, MDB_val *data, assert(key); assert(key->mv_size > 0); + if (mc->mc_db->md_flags & MDB_DUPSORT) + mc->mc_xcursor->mx_cursor.mc_flags &= ~(C_INITIALIZED|C_EOF); + /* See if we're already on the right page */ if (mc->mc_flags & C_INITIALIZED) { MDB_val nodekey;