ITS#7213 fix page_split with MDB_APPEND

don't skip the cursor adjust checks
vmware
Howard Chu 13 years ago
parent 25e8e82c5f
commit 8a4981d8aa
  1. 12
      libraries/libmdb/mdb.c

@ -5665,7 +5665,10 @@ newsep:
if (nflags & MDB_APPEND) { if (nflags & MDB_APPEND) {
mc->mc_pg[mc->mc_top] = rp; mc->mc_pg[mc->mc_top] = rp;
mc->mc_ki[mc->mc_top] = 0; mc->mc_ki[mc->mc_top] = 0;
return mdb_node_add(mc, 0, newkey, newdata, newpgno, nflags); rc = mdb_node_add(mc, 0, newkey, newdata, newpgno, nflags);
if (rc)
return rc;
goto done;
} }
if (IS_LEAF2(rp)) { if (IS_LEAF2(rp)) {
goto done; goto done;
@ -5772,10 +5775,11 @@ done:
if (!(m3->mc_flags & C_INITIALIZED)) if (!(m3->mc_flags & C_INITIALIZED))
continue; continue;
if (new_root) { if (new_root) {
int k;
/* root split */ /* root split */
for (i=m3->mc_top; i>0; i--) { for (k=m3->mc_top; k>=0; k--) {
m3->mc_ki[i+1] = m3->mc_ki[i]; m3->mc_ki[k+1] = m3->mc_ki[k];
m3->mc_pg[i+1] = m3->mc_pg[i]; m3->mc_pg[k+1] = m3->mc_pg[k];
} }
m3->mc_ki[0] = mc->mc_ki[0]; m3->mc_ki[0] = mc->mc_ki[0];
m3->mc_pg[0] = mc->mc_pg[0]; m3->mc_pg[0] = mc->mc_pg[0];

Loading…
Cancel
Save