summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/lsm/lsm_cursor.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/src/lsm/lsm_cursor.c')
-rw-r--r--src/third_party/wiredtiger/src/lsm/lsm_cursor.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/third_party/wiredtiger/src/lsm/lsm_cursor.c b/src/third_party/wiredtiger/src/lsm/lsm_cursor.c
index 18a26bebff0..6052d20025f 100644
--- a/src/third_party/wiredtiger/src/lsm/lsm_cursor.c
+++ b/src/third_party/wiredtiger/src/lsm/lsm_cursor.c
@@ -104,10 +104,10 @@ __clsm_enter_update(WT_CURSOR_LSM *clsm)
} else {
primary = clsm->chunks[clsm->nchunks - 1]->cursor;
primary_chunk = clsm->primary_chunk;
- WT_ASSERT(session, F_ISSET(&session->txn, WT_TXN_HAS_ID));
+ WT_ASSERT(session, F_ISSET(session->txn, WT_TXN_HAS_ID));
have_primary = (primary != NULL && primary_chunk != NULL &&
(primary_chunk->switch_txn == WT_TXN_NONE ||
- WT_TXNID_LT(session->txn.id, primary_chunk->switch_txn)));
+ WT_TXNID_LT(session->txn->id, primary_chunk->switch_txn)));
}
/*
@@ -160,7 +160,7 @@ __clsm_enter(WT_CURSOR_LSM *clsm, bool reset, bool update)
lsm_tree = clsm->lsm_tree;
session = (WT_SESSION_IMPL *)clsm->iface.session;
- txn = &session->txn;
+ txn = session->txn;
/* Merge cursors never update. */
if (F_ISSET(clsm, WT_CLSM_MERGE))
@@ -209,7 +209,7 @@ __clsm_enter(WT_CURSOR_LSM *clsm, bool reset, bool update)
clsm->nupdates = 1;
if (txn->isolation == WT_ISO_SNAPSHOT && F_ISSET(clsm, WT_CLSM_OPEN_SNAPSHOT)) {
WT_ASSERT(session, F_ISSET(txn, WT_TXN_HAS_SNAPSHOT));
- pinned_id = WT_SESSION_TXN_STATE(session)->pinned_id;
+ pinned_id = WT_SESSION_TXN_SHARED(session)->pinned_id;
for (i = clsm->nchunks - 2; clsm->nupdates < clsm->nchunks; clsm->nupdates++, i--) {
switch_txn = clsm->chunks[i]->switch_txn;
if (WT_TXNID_LT(switch_txn, pinned_id))
@@ -429,7 +429,7 @@ __clsm_open_cursors(WT_CURSOR_LSM *clsm, bool update, u_int start_chunk, uint32_
c = &clsm->iface;
cursor = NULL;
session = (WT_SESSION_IMPL *)c->session;
- txn = &session->txn;
+ txn = session->txn;
chunk = NULL;
locked = false;
lsm_tree = clsm->lsm_tree;
@@ -832,7 +832,7 @@ __clsm_position_chunk(WT_CURSOR_LSM *clsm, WT_CURSOR *c, bool forward, int *cmpp
* and stepping forward / back. In that case, keep going until we see a key in the expected
* range.
*/
- if (session->txn.isolation != WT_ISO_READ_UNCOMMITTED)
+ if (session->txn->isolation != WT_ISO_READ_UNCOMMITTED)
return (0);
WT_RET(WT_LSM_CURCMP(session, clsm->lsm_tree, c, cursor, *cmpp));
@@ -1386,9 +1386,9 @@ __clsm_put(WT_SESSION_IMPL *session, WT_CURSOR_LSM *clsm, const WT_ITEM *key, co
lsm_tree = clsm->lsm_tree;
- WT_ASSERT(session, F_ISSET(&session->txn, WT_TXN_HAS_ID) && clsm->primary_chunk != NULL &&
+ WT_ASSERT(session, F_ISSET(session->txn, WT_TXN_HAS_ID) && clsm->primary_chunk != NULL &&
(clsm->primary_chunk->switch_txn == WT_TXN_NONE ||
- WT_TXNID_LE(session->txn.id, clsm->primary_chunk->switch_txn)));
+ WT_TXNID_LE(session->txn->id, clsm->primary_chunk->switch_txn)));
/*
* Clear the existing cursor position. Don't clear the primary cursor: we're about to use it
@@ -1618,12 +1618,11 @@ err:
CURSOR_UPDATE_API_END(session, ret);
/*
- * The application might do a WT_CURSOR.get_value call when we return,
- * so we need a value and the underlying functions didn't set one up.
- * For various reasons, those functions may not have done a search and
- * any previous value in the cursor might race with WT_CURSOR.reserve
- * (and in cases like LSM, the reserve never encountered the original
- * key). For simplicity, repeat the search here.
+ * The application might do a WT_CURSOR.get_value call when we return, so we need a value and
+ * the underlying functions didn't set one up. For various reasons, those functions may not have
+ * done a search and any previous value in the cursor might race with WT_CURSOR.reserve (and in
+ * cases like LSM, the reserve never encountered the original key). For simplicity, repeat the
+ * search here.
*/
return (ret == 0 ? cursor->search(cursor) : ret);
}