Append mode should also detect keys that are too small

vmware
Howard Chu 13 years ago
parent 5da67968af
commit d3990eb2f8
  1. 4
      libraries/libmdb/mdb.c

@ -4261,9 +4261,11 @@ mdb_cursor_put(MDB_cursor *mc, MDB_val *key, MDB_val *data,
rc = mdb_cursor_last(mc, &k2, &d2); rc = mdb_cursor_last(mc, &k2, &d2);
if (rc == 0) { if (rc == 0) {
rc = mc->mc_dbx->md_cmp(key, &k2); rc = mc->mc_dbx->md_cmp(key, &k2);
if (rc) { if (rc > 0) {
rc = MDB_NOTFOUND; rc = MDB_NOTFOUND;
mc->mc_ki[mc->mc_top]++; mc->mc_ki[mc->mc_top]++;
} else {
rc = 0;
} }
} }
} else { } else {

Loading…
Cancel
Save