summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/btree/bt_ret.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/src/btree/bt_ret.c')
-rw-r--r--src/third_party/wiredtiger/src/btree/bt_ret.c50
1 files changed, 15 insertions, 35 deletions
diff --git a/src/third_party/wiredtiger/src/btree/bt_ret.c b/src/third_party/wiredtiger/src/btree/bt_ret.c
index b182b1f8468..04393a228ac 100644
--- a/src/third_party/wiredtiger/src/btree/bt_ret.c
+++ b/src/third_party/wiredtiger/src/btree/bt_ret.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2019 MongoDB, Inc.
+ * Copyright (c) 2014-2020 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -127,7 +127,7 @@ __value_return(WT_CURSOR_BTREE *cbt)
* Change the cursor to reference an internal update structure return value.
*/
int
-__wt_value_return_upd(WT_CURSOR_BTREE *cbt, WT_UPDATE *upd, bool ignore_visibility)
+__wt_value_return_upd(WT_CURSOR_BTREE *cbt, WT_UPDATE *upd)
{
WT_CURSOR *cursor;
WT_DECL_RET;
@@ -135,7 +135,6 @@ __wt_value_return_upd(WT_CURSOR_BTREE *cbt, WT_UPDATE *upd, bool ignore_visibili
WT_UPDATE **listp, *list[WT_MODIFY_ARRAY_SIZE];
size_t allocated_bytes;
u_int i;
- bool skipped_birthmark;
cursor = &cbt->iface;
session = (WT_SESSION_IMPL *)cbt->iface.session;
@@ -155,18 +154,12 @@ __wt_value_return_upd(WT_CURSOR_BTREE *cbt, WT_UPDATE *upd, bool ignore_visibili
WT_ASSERT(session, upd->type == WT_UPDATE_MODIFY);
/*
- * Find a complete update that's visible to us, tracking modifications that are visible to us.
+ * Find a complete update.
*/
- for (i = 0, listp = list, skipped_birthmark = false; upd != NULL; upd = upd->next) {
+ for (i = 0, listp = list; upd != NULL; upd = upd->next) {
if (upd->txnid == WT_TXN_ABORTED)
continue;
- if (!ignore_visibility && !__wt_txn_upd_visible(session, upd)) {
- if (upd->type == WT_UPDATE_BIRTHMARK)
- skipped_birthmark = true;
- continue;
- }
-
if (upd->type == WT_UPDATE_BIRTHMARK) {
upd = NULL;
break;
@@ -189,36 +182,23 @@ __wt_value_return_upd(WT_CURSOR_BTREE *cbt, WT_UPDATE *upd, bool ignore_visibili
memcpy(listp, list, sizeof(list));
}
listp[i++] = upd;
-
- /*
- * Once a modify is found, all previously committed modifications should be applied
- * regardless of visibility.
- */
- ignore_visibility = true;
}
}
/*
- * If there's no visible update and we skipped a birthmark, the base item is an empty item (in
- * other words, birthmarks we can't read act as tombstones). If there's no visible update and we
- * didn't skip a birthmark, the base item is the on-page item, which must be globally visible.
- * If there's a visible update and it's a tombstone, the base item is an empty item. If there's
- * a visible update and it's not a tombstone, the base item is the on-page item.
+ * If there's no full update, the base item is the on-page item. If the update is a tombstone,
+ * the base item is an empty item.
*/
if (upd == NULL) {
- if (skipped_birthmark)
- WT_ERR(__wt_buf_set(session, &cursor->value, "", 0));
- else {
- /*
- * Callers of this function set the cursor slot to an impossible value to check we don't
- * try and return on-page values when the update list should have been sufficient (which
- * happens, for example, if an update list was truncated, deleting some standard update
- * required by a previous modify update). Assert the case.
- */
- WT_ASSERT(session, cbt->slot != UINT32_MAX);
+ /*
+ * Callers of this function set the cursor slot to an impossible value to check we don't try
+ * and return on-page values when the update list should have been sufficient (which
+ * happens, for example, if an update list was truncated, deleting some standard update
+ * required by a previous modify update). Assert the case.
+ */
+ WT_ASSERT(session, cbt->slot != UINT32_MAX);
- WT_ERR(__value_return(cbt));
- }
+ WT_ERR(__value_return(cbt));
} else if (upd->type == WT_UPDATE_TOMBSTONE)
WT_ERR(__wt_buf_set(session, &cursor->value, "", 0));
else
@@ -278,7 +258,7 @@ __wt_value_return(WT_CURSOR_BTREE *cbt, WT_UPDATE *upd)
if (upd == NULL)
WT_RET(__value_return(cbt));
else
- WT_RET(__wt_value_return_upd(cbt, upd, false));
+ WT_RET(__wt_value_return_upd(cbt, upd));
F_SET(cursor, WT_CURSTD_VALUE_INT);
return (0);
}