summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/cursor/cur_file.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/src/cursor/cur_file.c')
-rw-r--r--src/third_party/wiredtiger/src/cursor/cur_file.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/third_party/wiredtiger/src/cursor/cur_file.c b/src/third_party/wiredtiger/src/cursor/cur_file.c
index a9f3124149e..c998565eb75 100644
--- a/src/third_party/wiredtiger/src/cursor/cur_file.c
+++ b/src/third_party/wiredtiger/src/cursor/cur_file.c
@@ -369,15 +369,20 @@ __curfile_close(WT_CURSOR *cursor)
__wt_buf_free(session, &cbulk->last);
}
- WT_TRET(__wt_btcur_close(cbt));
- if (cbt->btree != NULL) {
+ WT_TRET(__wt_btcur_close(cbt, 0));
+ /* The URI is owned by the btree handle. */
+ cursor->internal_uri = NULL;
+ WT_TRET(__wt_cursor_close(cursor));
+
+ /*
+ * Note: release the data handle last so that cursor statistics are
+ * updated correctly.
+ */
+ if (session->dhandle != NULL) {
/* Increment the data-source's in-use counter. */
__wt_cursor_dhandle_decr_use(session);
WT_TRET(__wt_session_release_btree(session));
}
- /* The URI is owned by the btree handle. */
- cursor->internal_uri = NULL;
- WT_TRET(__wt_cursor_close(cursor));
err: API_END_RET(session, ret);
}