From: Howard Chu Date: Fri, 29 Mar 2013 08:08:06 +0000 (-0700) Subject: Fix CURSOR_LAST/CURSOR_PREV X-Git-Tag: OPENLDAP_REL_ENG_2_4_36~89^2~14 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7aae15739b2c77bb601c98b112c804f51778a33b;p=openldap Fix CURSOR_LAST/CURSOR_PREV --- diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 7866e89cb6..04a9f1c977 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -4791,7 +4791,7 @@ fetchm: case MDB_PREV: case MDB_PREV_DUP: case MDB_PREV_NODUP: - if (!(mc->mc_flags & C_INITIALIZED) || (mc->mc_flags & C_EOF)) { + if (!(mc->mc_flags & C_INITIALIZED)) { rc = mdb_cursor_last(mc, key, data); mc->mc_flags |= C_INITIALIZED; mc->mc_ki[mc->mc_top]++; diff --git a/libraries/liblmdb/mtest.c b/libraries/liblmdb/mtest.c index 8c8dd57835..42b8658507 100644 --- a/libraries/liblmdb/mtest.c +++ b/libraries/liblmdb/mtest.c @@ -25,7 +25,7 @@ int main(int argc,char * argv[]) MDB_val key, data; MDB_txn *txn; MDB_stat mst; - MDB_cursor *cursor; + MDB_cursor *cursor, *cur2; int count; int *values; char sval[32]; @@ -54,7 +54,11 @@ int main(int argc,char * argv[]) for (i=0;i