mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-24 13:24:56 +08:00
ITS#7594 more for subDB cursor fix
This commit is contained in:
parent
3b623d66e1
commit
aff123ba11
@ -5413,8 +5413,18 @@ mdb_cursor_del(MDB_cursor *mc, unsigned int flags)
|
|||||||
void *db = NODEDATA(leaf);
|
void *db = NODEDATA(leaf);
|
||||||
memcpy(db, &mc->mc_xcursor->mx_db, sizeof(MDB_db));
|
memcpy(db, &mc->mc_xcursor->mx_db, sizeof(MDB_db));
|
||||||
} else {
|
} else {
|
||||||
|
MDB_cursor *m2;
|
||||||
/* shrink fake page */
|
/* shrink fake page */
|
||||||
mdb_node_shrink(mc->mc_pg[mc->mc_top], mc->mc_ki[mc->mc_top]);
|
mdb_node_shrink(mc->mc_pg[mc->mc_top], mc->mc_ki[mc->mc_top]);
|
||||||
|
leaf = NODEPTR(mc->mc_pg[mc->mc_top], mc->mc_ki[mc->mc_top]);
|
||||||
|
mc->mc_xcursor->mx_cursor.mc_pg[0] = NODEDATA(leaf);
|
||||||
|
/* fix other sub-DB cursors pointed at this fake page */
|
||||||
|
for (m2 = mc->mc_txn->mt_cursors[mc->mc_dbi]; m2; m2=m2->mc_next) {
|
||||||
|
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_ki[mc->mc_top] == mc->mc_ki[mc->mc_top])
|
||||||
|
m2->mc_xcursor->mx_cursor.mc_pg[0] = NODEDATA(leaf);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
mc->mc_db->md_entries--;
|
mc->mc_db->md_entries--;
|
||||||
return rc;
|
return rc;
|
||||||
|
Loading…
Reference in New Issue
Block a user