return rc;
}
} else {
- mc->mc_xcursor->mx_cursor.mc_flags = 0;
+ mc->mc_xcursor->mx_cursor.mc_flags &= ~C_INITIALIZED;
if (op == MDB_NEXT_DUP)
return MDB_NOTFOUND;
}
if (op != MDB_PREV || rc == MDB_SUCCESS)
return rc;
} else {
- mc->mc_xcursor->mx_cursor.mc_flags = 0;
+ mc->mc_xcursor->mx_cursor.mc_flags &= ~C_INITIALIZED;
if (op == MDB_PREV_DUP)
return MDB_NOTFOUND;
}
} else {
if (mc->mc_xcursor)
- mc->mc_xcursor->mx_cursor.mc_flags = 0;
+ mc->mc_xcursor->mx_cursor.mc_flags &= ~C_INITIALIZED;
if ((rc = mdb_node_read(mc->mc_txn, leaf, data)) != MDB_SUCCESS)
return rc;
}
return rc;
} else {
if (mc->mc_xcursor)
- mc->mc_xcursor->mx_cursor.mc_flags = 0;
+ mc->mc_xcursor->mx_cursor.mc_flags &= ~C_INITIALIZED;
if ((rc = mdb_node_read(mc->mc_txn, leaf, data)) != MDB_SUCCESS)
return rc;
}
return rc;
} else {
if (mc->mc_xcursor)
- mc->mc_xcursor->mx_cursor.mc_flags = 0;
+ mc->mc_xcursor->mx_cursor.mc_flags &= ~C_INITIALIZED;
if ((rc = mdb_node_read(mc->mc_txn, leaf, data)) != MDB_SUCCESS)
return rc;
}
int exact = 0;
MDB_val d2;
rc = mdb_cursor_set(mc, key, &d2, MDB_SET, &exact);
- if (flags == MDB_NOOVERWRITE && rc == 0) {
+ if ((flags & MDB_NOOVERWRITE) && rc == 0) {
DPRINTF("duplicate key [%s]", DKEY(key));
*data = d2;
return MDB_KEYEXIST;
mx->mx_cursor.mc_dbx = &mx->mx_dbx;
mx->mx_cursor.mc_dbi = mc->mc_dbi+1;
mx->mx_cursor.mc_dbflag = &mx->mx_dbflag;
+ mx->mx_cursor.mc_snum = 0;
+ mx->mx_cursor.mc_flags = C_SUB;
mx->mx_dbx.md_cmp = mc->mc_dbx->md_dcmp;
mx->mx_dbx.md_dcmp = NULL;
mx->mx_dbx.md_rel = mc->mc_dbx->md_rel;
m3 = &m2->mc_xcursor->mx_cursor;
else
m3 = m2;
+ if (!(m3->mc_flags & C_INITIALIZED))
+ continue;
if (new_root) {
/* root split */
for (i=m3->mc_top; i>0; i--) {