ITS#8109 fix mdb_cursor_del0 on empty DB

mdb.RE/0.9
Howard Chu 10 years ago
parent 8cf73291fb
commit b7511480c5
  1. 7
      libraries/liblmdb/mdb.c

@ -7845,6 +7845,13 @@ mdb_cursor_del0(MDB_cursor *mc)
MDB_cursor *m2, *m3; MDB_cursor *m2, *m3;
MDB_dbi dbi = mc->mc_dbi; MDB_dbi dbi = mc->mc_dbi;
/* DB is totally empty now, just bail out.
* Other cursors adjustments were already done
* by mdb_rebalance and aren't needed here.
*/
if (!mc->mc_snum)
return rc;
mp = mc->mc_pg[mc->mc_top]; mp = mc->mc_pg[mc->mc_top];
nkeys = NUMKEYS(mp); nkeys = NUMKEYS(mp);

Loading…
Cancel
Save