From: Howard Chu Date: Tue, 8 Jul 2014 18:54:24 +0000 (-0700) Subject: Re-fix cursor EOF X-Git-Tag: submit/tizen/20180312.054306~365 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b3e8c71dc7d629f6311801774d275712bf72631f;p=platform%2Fupstream%2Flmdb.git Re-fix cursor EOF Fix in 534dcc721287cfe1051191a5cd7d3df6cf1dc409 was in wrong place --- diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index d31cdb2..ac18507 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -6352,7 +6352,6 @@ mdb_cursor_del(MDB_cursor *mc, unsigned int flags) return rc; } /* otherwise fall thru and delete the sub-DB */ - mc->mc_xcursor->mx_cursor.mc_flags |= C_EOF; } if (leaf->mn_flags & F_SUBDATA) { @@ -7537,8 +7536,10 @@ mdb_cursor_del0(MDB_cursor *mc) /* if mc points past last node in page, find next sibling */ if (mc->mc_ki[mc->mc_top] >= nkeys) { rc = mdb_cursor_sibling(mc, 1); - if (rc == MDB_NOTFOUND) + if (rc == MDB_NOTFOUND) { + mc->mc_flags |= C_EOF; rc = MDB_SUCCESS; + } } /* Adjust other cursors pointing to mp */ @@ -7556,8 +7557,10 @@ mdb_cursor_del0(MDB_cursor *mc) } if (m3->mc_ki[mc->mc_top] >= nkeys) { rc = mdb_cursor_sibling(m3, 1); - if (rc == MDB_NOTFOUND) + if (rc == MDB_NOTFOUND) { + m3->mc_flags |= C_EOF; rc = MDB_SUCCESS; + } } } }