projects
/
platform
/
upstream
/
lmdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
14fb1f5
)
Append mode still needs to detect duplicates
author
Howard Chu
<hyc@symas.com>
Mon, 23 Jul 2012 00:41:58 +0000
(17:41 -0700)
committer
Howard Chu
<hyc@symas.com>
Mon, 23 Jul 2012 00:45:50 +0000
(17:45 -0700)
libraries/libmdb/mdb.c
patch
|
blob
|
history
diff --git
a/libraries/libmdb/mdb.c
b/libraries/libmdb/mdb.c
index
ad9ff44
..
21fa977
100644
(file)
--- a/
libraries/libmdb/mdb.c
+++ b/
libraries/libmdb/mdb.c
@@
-4247,8
+4247,11
@@
mdb_cursor_put(MDB_cursor *mc, MDB_val *key, MDB_val *data,
MDB_val k2;
rc = mdb_cursor_last(mc, &k2, &d2);
if (rc == 0) {
- rc = MDB_NOTFOUND;
- mc->mc_ki[mc->mc_top]++;
+ rc = mc->mc_dbx->md_cmp(key, &k2);
+ if (rc) {
+ rc = MDB_NOTFOUND;
+ mc->mc_ki[mc->mc_top]++;
+ }
}
} else {
rc = mdb_cursor_set(mc, key, &d2, MDB_SET, &exact);