summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/btree/bt_cursor.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/src/btree/bt_cursor.c')
-rw-r--r--src/third_party/wiredtiger/src/btree/bt_cursor.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/third_party/wiredtiger/src/btree/bt_cursor.c b/src/third_party/wiredtiger/src/btree/bt_cursor.c
index 2cbf4352e2a..2eafebe31be 100644
--- a/src/third_party/wiredtiger/src/btree/bt_cursor.c
+++ b/src/third_party/wiredtiger/src/btree/bt_cursor.c
@@ -1855,10 +1855,11 @@ __cursor_truncate(WT_CURSOR_BTREE *start, WT_CURSOR_BTREE *stop,
{
WT_DECL_RET;
WT_SESSION_IMPL *session;
+ size_t records_truncated;
uint64_t yield_count, sleep_usecs;
session = CUR2S(start);
- yield_count = sleep_usecs = 0;
+ records_truncated = yield_count = sleep_usecs = 0;
/*
* First, call the cursor search method to re-position the cursor: we may not have a cursor position
@@ -1881,12 +1882,17 @@ retry:
for (;;) {
WT_ERR(rmfunc(start, NULL, WT_UPDATE_TOMBSTONE));
+ ++records_truncated;
- if (stop != NULL && __cursor_equals(start, stop))
+ if (stop != NULL && __cursor_equals(start, stop)) {
+ WT_STAT_CONN_INCRV(session, cursor_truncate_keys_deleted, records_truncated);
return (0);
+ }
- if ((ret = __wt_btcur_next(start, true)) == WT_NOTFOUND)
+ if ((ret = __wt_btcur_next(start, true)) == WT_NOTFOUND) {
+ WT_STAT_CONN_INCRV(session, cursor_truncate_keys_deleted, records_truncated);
return (0);
+ }
WT_ERR(ret);
start->compare = 0; /* Exact match */
@@ -1964,7 +1970,7 @@ err:
* Discard a cursor range from the tree.
*/
int
-__wt_btcur_range_truncate(WT_CURSOR_BTREE *start, WT_CURSOR_BTREE *stop)
+__wt_btcur_range_truncate(WT_CURSOR_BTREE *start, WT_CURSOR_BTREE *stop, bool *is_col_fix)
{
WT_BTREE *btree;
WT_DECL_RET;
@@ -2005,6 +2011,7 @@ __wt_btcur_range_truncate(WT_CURSOR_BTREE *start, WT_CURSOR_BTREE *stop)
switch (btree->type) {
case BTREE_COL_FIX:
WT_ERR(__cursor_truncate_fix(start, stop, __cursor_col_modify));
+ *is_col_fix = true;
break;
case BTREE_COL_VAR:
WT_ERR(__cursor_truncate(start, stop, __cursor_col_modify));