From: Howard Chu Date: Fri, 19 Aug 2011 02:30:54 +0000 (-0700) Subject: Fix dupsort fetch X-Git-Tag: OPENLDAP_REL_ENG_2_4_27~148^2~94 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=11308a190d31e2c9aee3c8ec8e87caf122afa58e;p=openldap Fix dupsort fetch --- diff --git a/libraries/libmdb/mdb.c b/libraries/libmdb/mdb.c index 135c10359f..6baf0556d5 100644 --- a/libraries/libmdb/mdb.c +++ b/libraries/libmdb/mdb.c @@ -2008,7 +2008,8 @@ mdb_cursor_set(MDB_cursor *cursor, MDB_val *key, MDB_val *data, cursor->mc_eof = 0; if (data) { - if ((rc = mdb_read_data(cursor->mc_txn, leaf, data)) != MDB_SUCCESS) + MDB_val d2; + if ((rc = mdb_read_data(cursor->mc_txn, leaf, &d2)) != MDB_SUCCESS) return rc; if (cursor->mc_txn->mt_dbs[cursor->mc_dbi].md_flags & MDB_DUPSORT) { @@ -2029,7 +2030,10 @@ mdb_cursor_set(MDB_cursor *cursor, MDB_val *key, MDB_val *data, if (rc != MDB_SUCCESS) return rc; } + } else { + *data = d2; } + } rc = mdb_set_key(leaf, key);