mdbx: fix xflags inside mdb_cursor_put().

Fix xflags preparation bug from 2956095c6d
This commit is contained in:
Leo Yuriev 2017-01-18 19:05:09 +03:00
parent 14b466bd2d
commit 5bb931f7c4

12
mdb.c
View File

@ -7143,15 +7143,13 @@ put_sub:
xdata.mv_size = 0;
xdata.mv_data = "";
leaf = NODEPTR(mc->mc_pg[mc->mc_top], mc->mc_ki[mc->mc_top]);
xflags = MDB_NOSPILL;
if (flags & MDB_NODUPDATA)
xflags |= MDB_NOOVERWRITE;
if (flags & MDB_APPENDDUP)
xflags |= MDB_APPEND;
if (flags & MDB_CURRENT) {
xflags |= MDB_CURRENT;
xflags = (flags & MDB_NODUPDATA) ?
MDB_CURRENT|MDB_NOOVERWRITE|MDB_NOSPILL : MDB_CURRENT|MDB_NOSPILL;
} else {
mdb_xcursor_init1(mc, leaf);
xflags = (flags & MDB_NODUPDATA) ?
MDB_NOOVERWRITE|MDB_NOSPILL : MDB_NOSPILL;
}
if (sub_root)
mc->mc_xcursor->mx_cursor.mc_pg[0] = sub_root;
@ -7185,6 +7183,8 @@ put_sub:
}
}
ecount = mc->mc_xcursor->mx_db.md_entries;
if (flags & MDB_APPENDDUP)
xflags |= MDB_APPEND;
rc = mdb_cursor_put(&mc->mc_xcursor->mx_cursor, data, &xdata, xflags);
if (flags & F_SUBDATA) {
void *db = NODEDATA(leaf);