]> git.sur5r.net Git - openldap/commitdiff
Fix f8ce8a82717ddefdc912fa47c07f1bdee2a3336b
authorHoward Chu <hyc@openldap.org>
Thu, 12 Jan 2017 13:35:31 +0000 (13:35 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 12 Jan 2017 13:35:31 +0000 (13:35 +0000)
GET_MULTIPLE was broken

libraries/liblmdb/mdb.c

index 3f893a8d1a3c3484c3457483706a2fdd58979978..649ff0103584a91a001504915d4d1f6e4b9a28d5 100644 (file)
@@ -7130,10 +7130,9 @@ mdb_cursor_get(MDB_cursor *mc, MDB_val *key, MDB_val *data,
                        rc = MDB_INCOMPATIBLE;
                        break;
                }
-               if (!(mc->mc_xcursor->mx_cursor.mc_flags & C_INITIALIZED)) {
-                       rc = EINVAL;
+               rc = MDB_SUCCESS;
+               if (!(mc->mc_xcursor->mx_cursor.mc_flags & C_INITIALIZED))
                        break;
-               }
                if (mc->mc_xcursor->mx_cursor.mc_flags & C_EOF) {
                        MDB_cursor *mx = &mc->mc_xcursor->mx_cursor;
                        if (mx->mc_ki[mx->mc_top] >= NUMKEYS(mx->mc_pg[mx->mc_top])-1) {
@@ -7142,7 +7141,6 @@ mdb_cursor_get(MDB_cursor *mc, MDB_val *key, MDB_val *data,
                        }
                        mx->mc_flags ^= C_EOF;
                }
-               rc = MDB_SUCCESS;
                goto fetchm;
        case MDB_NEXT_MULTIPLE:
                if (data == NULL) {