wiredtiger/wiredtiger — Issue #158: cursor.reset method
Author: keithbostic
Created: 2012-02-01 17:39:30+00:00
State: open
Labels: Bug

Michael, when you wrote cursor.reset:

```
/*
* __wt_btcur_reset --
* Invalidate the cursor position.
*/
int
__wt_btcur_reset(WT_CURSOR_BTREE *cbt)
{
WT_SESSION_IMPL *session;

session = (WT_SESSION_IMPL *)cbt->iface.session;
WT_BSTAT_INCR(session, cursor_resets);

__cursor_func_init(cbt, 1);
cbt->recno = 0;
F_CLR(cbt,
WT_CBT_ITERATE_APPEND | WT_CBT_ITERATE_NEXT | WT_CBT_ITERATE_PREV);

return (0);
}
```

Did you consider calling __cursor_search_clear() instead of clearing recno and the iteration flags explicitly?

I'm a little worried we don't clear WT_CBT_MAX_RECORD and WT_CBT_SEARCH_SMALLEST, for example, although I'm pretty sure it works, it's just I'm worried about future behavior if some surrounding code changes.

Thoughts?

--keith