From: Howard Chu Date: Wed, 5 Jun 2013 22:23:54 +0000 (-0700) Subject: ITS#7594 better fix X-Git-Tag: OPENLDAP_REL_ENG_2_4_36~36^2~28 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3b623d66e1e0d1fd78d85e5e657b1a167dba8a51;p=openldap ITS#7594 better fix Update the subDB cursor, don't invalidate it --- diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 33b9d47668..0e14320214 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -1636,8 +1636,13 @@ finish: if (m2 == mc || m2->mc_snum < mc->mc_snum) continue; if (m2->mc_pg[mc->mc_top] == mc->mc_pg[mc->mc_top]) { m2->mc_pg[mc->mc_top] = mp; - if (mc->mc_db->md_flags & MDB_DUPSORT) - m2->mc_xcursor->mx_cursor.mc_flags &= ~C_INITIALIZED; + if ((mc->mc_db->md_flags & MDB_DUPSORT) && + m2->mc_ki[mc->mc_top] == mc->mc_ki[mc->mc_top]) { + MDB_node *leaf = NODEPTR(mp, mc->mc_ki[mc->mc_top]); + if (!(leaf->mn_flags & F_SUBDATA)) { + m2->mc_xcursor->mx_cursor.mc_pg[0] = NODEDATA(leaf); + } + } } } }