mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-27 03:20:22 +08:00
More fixes for MDB_LAST
Make sure C_INITIALIZED gets set on successful call
This commit is contained in:
parent
3213fc4db7
commit
cb1cc64831
@ -4669,9 +4669,9 @@ mdb_cursor_last(MDB_cursor *mc, MDB_val *key, MDB_val *data)
|
||||
}
|
||||
assert(IS_LEAF(mc->mc_pg[mc->mc_top]));
|
||||
|
||||
mc->mc_flags |= C_INITIALIZED|C_EOF;
|
||||
mc->mc_ki[mc->mc_top] = NUMKEYS(mc->mc_pg[mc->mc_top]) - 1;
|
||||
}
|
||||
mc->mc_flags |= C_INITIALIZED|C_EOF;
|
||||
leaf = NODEPTR(mc->mc_pg[mc->mc_top], mc->mc_ki[mc->mc_top]);
|
||||
|
||||
if (IS_LEAF2(mc->mc_pg[mc->mc_top])) {
|
||||
|
@ -101,6 +101,11 @@ int main(int argc,char * argv[])
|
||||
(int) key.mv_size, (char *) key.mv_data,
|
||||
(int) data.mv_size, (char *) data.mv_data);
|
||||
}
|
||||
printf("Cursor last\n");
|
||||
rc = mdb_cursor_get(cursor, &key, &data, MDB_LAST);
|
||||
printf("key: %.*s, data: %.*s\n",
|
||||
(int) key.mv_size, (char *) key.mv_data,
|
||||
(int) data.mv_size, (char *) data.mv_data);
|
||||
printf("Cursor prev\n");
|
||||
while ((rc = mdb_cursor_get(cursor, &key, &data, MDB_PREV)) == 0) {
|
||||
printf("key: %.*s, data: %.*s\n",
|
||||
|
Loading…
Reference in New Issue
Block a user