ITS#7955, #7671 fix MDB_PREV_DUP
authorHoward Chu <hyc@symas.com>
Thu, 2 Oct 2014 20:58:20 +0000 (21:58 +0100)
committerHoward Chu <hyc@symas.com>
Thu, 2 Oct 2014 20:58:20 +0000 (21:58 +0100)
libraries/liblmdb/mdb.c

index 11cdc33d12afb658965eff66b241ffd6faebe535..6a9fd97a5a3839f1cf4747c4f501265ce946f5c5 100644 (file)
@@ -5457,11 +5457,11 @@ mdb_cursor_prev(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op)
                                        }
                                        return rc;
                                }
                                        }
                                        return rc;
                                }
-                       } else {
-                               mc->mc_xcursor->mx_cursor.mc_flags &= ~(C_INITIALIZED|C_EOF);
-                               if (op == MDB_PREV_DUP)
-                                       return MDB_NOTFOUND;
                        }
                        }
+               } else {
+                       mc->mc_xcursor->mx_cursor.mc_flags &= ~(C_INITIALIZED|C_EOF);
+                       if (op == MDB_PREV_DUP)
+                               return MDB_NOTFOUND;
                }
        }
 
                }
        }