diff options
author | Dan Pasette <dan@10gen.com> | 2015-02-04 06:48:51 -0500 |
---|---|---|
committer | Dan Pasette <dan@mongodb.com> | 2015-02-04 06:55:52 -0500 |
commit | 7d9ec251cf0e70bc0f9bb246aacfb6e62226ad37 (patch) | |
tree | 5b436359112bc5610dcf9fd1e1f7331854b388d6 /src/third_party/wiredtiger/src/btree/bt_cursor.c | |
parent | fc14926f9c8256edce8bbd15d439ca34667c6ebb (diff) | |
download | mongo-7d9ec251cf0e70bc0f9bb246aacfb6e62226ad37.tar.gz |
Import wiredtiger-wiredtiger-mongodb-2.8-rc7-105-g92325a3.tar.gz from wiredtiger branch mongodb-2.8
Diffstat (limited to 'src/third_party/wiredtiger/src/btree/bt_cursor.c')
-rw-r--r-- | src/third_party/wiredtiger/src/btree/bt_cursor.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/third_party/wiredtiger/src/btree/bt_cursor.c b/src/third_party/wiredtiger/src/btree/bt_cursor.c index 704b258a7dd..1960e4605ef 100644 --- a/src/third_party/wiredtiger/src/btree/bt_cursor.c +++ b/src/third_party/wiredtiger/src/btree/bt_cursor.c @@ -782,7 +782,9 @@ __wt_btcur_next_random(WT_CURSOR_BTREE *cbt) WT_RET(__cursor_func_init(cbt, 1)); - WT_ERR(__wt_row_random(session, cbt)); + WT_WITH_PAGE_INDEX(session, + ret = __wt_row_random(session, cbt)); + WT_ERR(ret); if (__cursor_valid(cbt, &upd)) WT_ERR(__wt_kv_return(session, cbt, upd)); else @@ -948,7 +950,11 @@ __cursor_truncate(WT_SESSION_IMPL *session, } else { do { WT_RET(__wt_btcur_remove(start)); - for (;;) { + /* + * Reset ret each time through so that we don't loop + * forever in the cursor equals case. + */ + for (ret = 0;;) { if (stop != NULL && __cursor_equals(start, stop)) break; @@ -1009,7 +1015,11 @@ __cursor_truncate_fix(WT_SESSION_IMPL *session, } else { do { WT_RET(__wt_btcur_remove(start)); - for (;;) { + /* + * Reset ret each time through so that we don't loop + * forever in the cursor equals case. + */ + for (ret = 0;;) { if (stop != NULL && __cursor_equals(start, stop)) break; |