diff options
author | Howard Chu <hyc@openldap.org> | 2016-01-24 11:32:49 +0000 |
---|---|---|
committer | Howard Chu <hyc@openldap.org> | 2016-01-24 11:35:42 +0000 |
commit | 8c215aa970215a58ee0df458813c0405ad27a6e9 (patch) | |
tree | 0c3f198801c976769d811d8aded5fb4542f8f41b /libraries/liblmdb/mdb.c | |
parent | b5018e26bc155baea94a3552696ea9b8f0dc7046 (diff) | |
download | lmdb-8c215aa970215a58ee0df458813c0405ad27a6e9.tar.gz lmdb-8c215aa970215a58ee0df458813c0405ad27a6e9.tar.bz2 lmdb-8c215aa970215a58ee0df458813c0405ad27a6e9.zip |
ITS#8355 fix subcursors
make sure C_DEL gets reset in subcursor after it moves.
Diffstat (limited to 'libraries/liblmdb/mdb.c')
-rw-r--r-- | libraries/liblmdb/mdb.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 895ab95..fa5416f 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -6458,8 +6458,10 @@ mdb_cursor_next(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) DPRINTF(("cursor_next: top page is %"Y"u in cursor %p", mdb_dbg_pgno(mp), (void *) mc)); - if (mc->mc_flags & C_DEL) + if (mc->mc_flags & C_DEL) { + mc->mc_flags ^= C_DEL; goto skip; + } if (mc->mc_ki[mc->mc_top] + 1u >= NUMKEYS(mp)) { DPUTS("=====> move to next sibling page"); @@ -6545,6 +6547,8 @@ mdb_cursor_prev(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) DPRINTF(("cursor_prev: top page is %"Y"u in cursor %p", mdb_dbg_pgno(mp), (void *) mc)); + mc->mc_flags &= ~(C_EOF|C_DEL); + if (mc->mc_ki[mc->mc_top] == 0) { DPUTS("=====> move to prev sibling page"); if ((rc = mdb_cursor_sibling(mc, 0)) != MDB_SUCCESS) { |