diff options
author | Keith Bostic <keith@wiredtiger.com> | 2012-09-16 13:21:22 +0000 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2012-09-16 13:21:22 +0000 |
commit | ae5d9dc8747c14d4d5ef7e0541e5601f6e391ff8 (patch) | |
tree | 98d75ac8d2ce01e4561966b8bfbc4be09491f3be | |
parent | d79cf1369edf64f40bb9e2625f39fda67e13c424 (diff) | |
download | mongo-ae5d9dc8747c14d4d5ef7e0541e5601f6e391ff8.tar.gz |
Messed up the last change: can't leave cbt->page set if we've released
the page.
-rw-r--r-- | src/btree/row_srch.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/btree/row_srch.c b/src/btree/row_srch.c index a4aa32402e2..bfcb0e8a740 100644 --- a/src/btree/row_srch.c +++ b/src/btree/row_srch.c @@ -274,9 +274,6 @@ __wt_row_random(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt) page = ref->page; } - cbt->page = page; - cbt->compare = 0; - if (page->entries != 0) { /* * The use case for this call is finding a place to split the @@ -286,6 +283,8 @@ __wt_row_random(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt) * or a tree with just one big page, that's not going to work, * check for that. */ + cbt->page = page; + cbt->compare = 0; cbt->slot = btree->root_page->entries < 2 ? __wt_random() % page->entries : 0; @@ -306,6 +305,8 @@ __wt_row_random(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt) break; t = WT_SKIP_NEXT(t); } + cbt->page = page; + cbt->compare = 0; cbt->ins = t; return (0); |