mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-24 13:24:56 +08:00
More for stale sub-cursor flags
Same fix for cursor_first/last.
This commit is contained in:
parent
56a41d87d4
commit
2c3488aeeb
@ -4856,7 +4856,7 @@ mdb_cursor_set(MDB_cursor *mc, MDB_val *key, MDB_val *data,
|
|||||||
assert(key);
|
assert(key);
|
||||||
assert(key->mv_size > 0);
|
assert(key->mv_size > 0);
|
||||||
|
|
||||||
if (mc->mc_db->md_flags & MDB_DUPSORT)
|
if (mc->mc_xcursor)
|
||||||
mc->mc_xcursor->mx_cursor.mc_flags &= ~(C_INITIALIZED|C_EOF);
|
mc->mc_xcursor->mx_cursor.mc_flags &= ~(C_INITIALIZED|C_EOF);
|
||||||
|
|
||||||
/* See if we're already on the right page */
|
/* See if we're already on the right page */
|
||||||
@ -5031,6 +5031,9 @@ mdb_cursor_first(MDB_cursor *mc, MDB_val *key, MDB_val *data)
|
|||||||
int rc;
|
int rc;
|
||||||
MDB_node *leaf;
|
MDB_node *leaf;
|
||||||
|
|
||||||
|
if (mc->mc_xcursor)
|
||||||
|
mc->mc_xcursor->mx_cursor.mc_flags &= ~(C_INITIALIZED|C_EOF);
|
||||||
|
|
||||||
if (!(mc->mc_flags & C_INITIALIZED) || mc->mc_top) {
|
if (!(mc->mc_flags & C_INITIALIZED) || mc->mc_top) {
|
||||||
rc = mdb_page_search(mc, NULL, 0);
|
rc = mdb_page_search(mc, NULL, 0);
|
||||||
if (rc != MDB_SUCCESS)
|
if (rc != MDB_SUCCESS)
|
||||||
@ -5057,8 +5060,6 @@ mdb_cursor_first(MDB_cursor *mc, MDB_val *key, MDB_val *data)
|
|||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
} else {
|
} else {
|
||||||
if (mc->mc_xcursor)
|
|
||||||
mc->mc_xcursor->mx_cursor.mc_flags &= ~(C_INITIALIZED|C_EOF);
|
|
||||||
if ((rc = mdb_node_read(mc->mc_txn, leaf, data)) != MDB_SUCCESS)
|
if ((rc = mdb_node_read(mc->mc_txn, leaf, data)) != MDB_SUCCESS)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -5074,6 +5075,9 @@ mdb_cursor_last(MDB_cursor *mc, MDB_val *key, MDB_val *data)
|
|||||||
int rc;
|
int rc;
|
||||||
MDB_node *leaf;
|
MDB_node *leaf;
|
||||||
|
|
||||||
|
if (mc->mc_xcursor)
|
||||||
|
mc->mc_xcursor->mx_cursor.mc_flags &= ~(C_INITIALIZED|C_EOF);
|
||||||
|
|
||||||
if (!(mc->mc_flags & C_EOF)) {
|
if (!(mc->mc_flags & C_EOF)) {
|
||||||
|
|
||||||
if (!(mc->mc_flags & C_INITIALIZED) || mc->mc_top) {
|
if (!(mc->mc_flags & C_INITIALIZED) || mc->mc_top) {
|
||||||
@ -5105,8 +5109,6 @@ mdb_cursor_last(MDB_cursor *mc, MDB_val *key, MDB_val *data)
|
|||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
} else {
|
} else {
|
||||||
if (mc->mc_xcursor)
|
|
||||||
mc->mc_xcursor->mx_cursor.mc_flags &= ~(C_INITIALIZED|C_EOF);
|
|
||||||
if ((rc = mdb_node_read(mc->mc_txn, leaf, data)) != MDB_SUCCESS)
|
if ((rc = mdb_node_read(mc->mc_txn, leaf, data)) != MDB_SUCCESS)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user