return rc;
}
} else {
- mc->mc_xcursor->mx_cursor.mc_flags &= ~C_INITIALIZED;
+ mc->mc_xcursor->mx_cursor.mc_flags &= ~(C_INITIALIZED|C_EOF);
if (op == MDB_NEXT_DUP)
return MDB_NOTFOUND;
}
DPUTS("=====> move to next sibling page");
if ((rc = mdb_cursor_sibling(mc, 1)) != MDB_SUCCESS) {
mc->mc_flags |= C_EOF;
- mc->mc_flags &= ~C_INITIALIZED;
return rc;
}
mp = mc->mc_pg[mc->mc_top];
if (op != MDB_PREV || rc != MDB_NOTFOUND)
return rc;
} else {
- mc->mc_xcursor->mx_cursor.mc_flags &= ~C_INITIALIZED;
+ mc->mc_xcursor->mx_cursor.mc_flags &= ~(C_INITIALIZED|C_EOF);
if (op == MDB_PREV_DUP)
return MDB_NOTFOUND;
}
if (mc->mc_ki[mc->mc_top] == 0) {
DPUTS("=====> move to prev sibling page");
if ((rc = mdb_cursor_sibling(mc, 0)) != MDB_SUCCESS) {
- mc->mc_flags &= ~C_INITIALIZED;
return rc;
}
mp = mc->mc_pg[mc->mc_top];
} else {
if (mc->mc_xcursor)
- mc->mc_xcursor->mx_cursor.mc_flags &= ~C_INITIALIZED;
+ mc->mc_xcursor->mx_cursor.mc_flags &= ~(C_INITIALIZED|C_EOF);
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 &= ~C_INITIALIZED;
+ mc->mc_xcursor->mx_cursor.mc_flags &= ~(C_INITIALIZED|C_EOF);
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 &= ~C_INITIALIZED;
+ mc->mc_xcursor->mx_cursor.mc_flags &= ~(C_INITIALIZED|C_EOF);
if ((rc = mdb_node_read(mc->mc_txn, leaf, data)) != MDB_SUCCESS)
return rc;
}
rc = mdb_page_merge(&mn, mc);
else
rc = mdb_page_merge(mc, &mn);
- mc->mc_flags &= ~C_INITIALIZED;
+ mc->mc_flags &= ~(C_INITIALIZED|C_EOF);
}
return rc;
}
mc->mc_txn->mt_flags |= MDB_TXN_ERROR;
/* if mc points past last node in page, invalidate */
else if (mc->mc_ki[mc->mc_top] >= NUMKEYS(mc->mc_pg[mc->mc_top]))
- mc->mc_flags &= ~C_INITIALIZED;
+ mc->mc_flags &= ~(C_INITIALIZED|C_EOF);
{
/* Adjust other cursors pointing to mp */
if (m2->mc_ki[mc->mc_top] > ki)
m2->mc_ki[mc->mc_top]--;
if (m2->mc_ki[mc->mc_top] >= nkeys)
- m2->mc_flags &= ~C_INITIALIZED;
+ m2->mc_flags &= ~(C_INITIALIZED|C_EOF);
}
}
}
rc = mdb_drop0(mc, mc->mc_db->md_flags & MDB_DUPSORT);
/* Invalidate the dropped DB's cursors */
for (m2 = txn->mt_cursors[dbi]; m2; m2 = m2->mc_next)
- m2->mc_flags &= ~C_INITIALIZED;
+ m2->mc_flags &= ~(C_INITIALIZED|C_EOF);
if (rc)
goto leave;