diff options
author | hyc <hyc@symas.com> | 2018-05-08 06:14:39 +0100 |
---|---|---|
committer | hyc <hyc@symas.com> | 2018-05-08 06:29:13 +0100 |
commit | 18cd6837b632dda74c7b2f8da4a5ce188a3cb235 (patch) | |
tree | b479271b1c57a040939880ef1fd2d1be7be34207 /external/db_drivers/liblmdb/mdb.c | |
parent | ITS#8831 move flag init into readhdr (diff) | |
download | monero-18cd6837b632dda74c7b2f8da4a5ce188a3cb235.tar.xz |
Fix mdb_load append option
Use MDB_CURRENT to avoid seeking to new key when appending DUPs.
Reinit cursor on new batch, if appending DUPs.
Diffstat (limited to 'external/db_drivers/liblmdb/mdb.c')
-rw-r--r-- | external/db_drivers/liblmdb/mdb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/external/db_drivers/liblmdb/mdb.c b/external/db_drivers/liblmdb/mdb.c index dde428c43..8e2b1eca1 100644 --- a/external/db_drivers/liblmdb/mdb.c +++ b/external/db_drivers/liblmdb/mdb.c @@ -7231,7 +7231,7 @@ mdb_cursor_put(MDB_cursor *mc, MDB_val *key, MDB_val *data, dkey.mv_size = 0; - if (flags == MDB_CURRENT) { + if (flags & MDB_CURRENT) { if (!(mc->mc_flags & C_INITIALIZED)) return EINVAL; rc = MDB_SUCCESS; @@ -7624,7 +7624,7 @@ put_sub: xdata.mv_size = 0; xdata.mv_data = ""; leaf = NODEPTR(mc->mc_pg[mc->mc_top], mc->mc_ki[mc->mc_top]); - if (flags & MDB_CURRENT) { + if (flags == MDB_CURRENT) { xflags = MDB_CURRENT|MDB_NOSPILL; } else { mdb_xcursor_init1(mc, leaf); |