if (cursor && cursor_push_page(cursor, mp) == NULL)
return MDB_FAIL;
- if (modify && (rc = mdb_touch(bt->md_env->me_txn, mpp)))
- return rc;
+ if (modify) {
+ MDB_dhead *dh = ((MDB_dhead *)mp)-1;
+ if (rc = mdb_touch(bt->md_env->me_txn, mpp))
+ return rc;
+ dh = ((MDB_dhead *)mpp->mp_page)-1;
+ dh->md_parent = mpp->mp_parent;
+ dh->md_pi = mpp->mp_pi;
+ }
+
mp = mpp->mp_page;
}
}
assert(IS_BRANCH(parent->mp_page));
-#if 0
indx = NODEPTR(parent->mp_page, parent->mp_ki);
- if ((mp = mdbenv_get_page(cursor->bt, indx->n_pgno)) == NULL)
+ if ((mp = mdbenv_get_page(cursor->mc_db->md_env, indx->mn_pgno)) == NULL)
return MDB_FAIL;
+#if 0
mp->parent = parent->mp_page;
mp->parent_index = parent->mp_ki;
#endif
env->me_txn->mt_next_pgno, env->me_head.mh_psize);
if ((dp = mdb_newpage(env->me_txn, NULL, 0, num)) == NULL)
return NULL;
- dp->p.mp_flags = flags;
+ dp->p.mp_flags = flags | P_DIRTY;
dp->p.mp_lower = PAGEHDRSZ;
dp->p.mp_upper = env->me_head.mh_psize;