diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/btree/bt_read.c | 10 | ||||
-rw-r--r-- | src/btree/bt_ret.c | 2 | ||||
-rw-r--r-- | src/btree/bt_split.c | 8 | ||||
-rw-r--r-- | src/btree/col_modify.c | 49 | ||||
-rw-r--r-- | src/reconcile/rec_write.c | 13 |
5 files changed, 38 insertions, 44 deletions
diff --git a/src/btree/bt_read.c b/src/btree/bt_read.c index 91c1499840e..004a6b6c943 100644 --- a/src/btree/bt_read.c +++ b/src/btree/bt_read.c @@ -86,7 +86,7 @@ __col_instantiate(WT_SESSION_IMPL *session, /* Search the page and add updates. */ WT_RET(__wt_col_search(session, recno, ref, cbt)); WT_RET(__wt_col_modify( - session, cbt, recno, NULL, upd, WT_UPDATE_STANDARD, false)); + session, cbt, recno, NULL, upd, upd->type, false)); return (0); } @@ -100,8 +100,7 @@ __row_instantiate(WT_SESSION_IMPL *session, { /* Search the page and add updates. */ WT_RET(__wt_row_search(session, key, ref, cbt, true)); - WT_RET(__wt_row_modify( - session, cbt, key, NULL, upd, WT_UPDATE_STANDARD, false)); + WT_RET(__wt_row_modify(session, cbt, key, NULL, upd, upd->type, false)); return (0); } @@ -187,9 +186,8 @@ __las_page_instantiate(WT_SESSION_IMPL *session, /* Allocate the WT_UPDATE structure. */ WT_ERR(cursor->get_value(cursor, &upd_txnid, &las_timestamp, &upd_type, &las_value)); - WT_ERR(__wt_update_alloc(session, &las_value, &upd, &incr, - upd_type == WT_UPDATE_DELETED ? - WT_UPDATE_DELETED : WT_UPDATE_STANDARD)); + WT_ERR(__wt_update_alloc( + session, &las_value, &upd, &incr, upd_type)); total_incr += incr; upd->txnid = upd_txnid; #ifdef HAVE_TIMESTAMPS diff --git a/src/btree/bt_ret.c b/src/btree/bt_ret.c index 4452e6eb0c6..120daed3935 100644 --- a/src/btree/bt_ret.c +++ b/src/btree/bt_ret.c @@ -216,7 +216,7 @@ __value_return_upd( WT_ERR(__wt_modify_apply( session, &cursor->value, listp[--i]->data)); -err: if (allocated_bytes) +err: if (allocated_bytes != 0) __wt_free(session, listp); return (ret); } diff --git a/src/btree/bt_split.c b/src/btree/bt_split.c index 2862c7fb6d7..a0db4457f62 100644 --- a/src/btree/bt_split.c +++ b/src/btree/bt_split.c @@ -1446,8 +1446,8 @@ __split_multi_inmem( WT_ERR(__wt_col_search(session, recno, ref, &cbt)); /* Apply the modification. */ - WT_ERR(__wt_col_modify(session, - &cbt, recno, NULL, upd, WT_UPDATE_STANDARD, true)); + WT_ERR(__wt_col_modify( + session, &cbt, recno, NULL, upd, upd->type, true)); break; case WT_PAGE_ROW_LEAF: /* Build a key. */ @@ -1468,8 +1468,8 @@ __split_multi_inmem( WT_ERR(__wt_row_search(session, key, ref, &cbt, true)); /* Apply the modification. */ - WT_ERR(__wt_row_modify(session, &cbt, - key, NULL, upd, WT_UPDATE_STANDARD, true)); + WT_ERR(__wt_row_modify( + session, &cbt, key, NULL, upd, upd->type, true)); break; WT_ILLEGAL_VALUE_ERR(session); } diff --git a/src/btree/col_modify.c b/src/btree/col_modify.c index 2a64ec03952..a51428dc62b 100644 --- a/src/btree/col_modify.c +++ b/src/btree/col_modify.c @@ -38,30 +38,33 @@ __wt_col_modify(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, upd = upd_arg; append = logged = false; - if (modify_type == WT_UPDATE_DELETED || - modify_type == WT_UPDATE_RESERVED) { - /* - * Fixed-size column-store doesn't have on-page deleted values, - * it's a nul byte. - */ - if (modify_type == WT_UPDATE_DELETED && - btree->type == BTREE_COL_FIX) { - modify_type = WT_UPDATE_STANDARD; - value = &col_fix_remove; + if (upd_arg == NULL) { + if (modify_type == WT_UPDATE_DELETED || + modify_type == WT_UPDATE_RESERVED) { + /* + * Fixed-size column-store doesn't have on-page deleted + * values, it's a nul byte. + */ + if (modify_type == WT_UPDATE_DELETED && + btree->type == BTREE_COL_FIX) { + modify_type = WT_UPDATE_STANDARD; + value = &col_fix_remove; + } + } else { + /* + * There's a chance the application specified a record + * past the last record on the page. If that's the + * case, and we're inserting a new WT_INSERT/WT_UPDATE + * pair, it goes on the append list, not the update + * list. Also, an out-of-band recno implies an append + * operation, we're allocating a new row. + */ + if (recno == WT_RECNO_OOB || + recno > (btree->type == BTREE_COL_VAR ? + __col_var_last_recno(cbt->ref) : + __col_fix_last_recno(cbt->ref))) + append = true; } - } else { - /* - * There's some chance the application specified a record past - * the last record on the page. If that's the case, and we're - * inserting a new WT_INSERT/WT_UPDATE pair, it goes on the - * append list, not the update list. Also, an out-of-band recno - * implies an append operation, we're allocating a new row. - */ - if (recno == WT_RECNO_OOB || - recno > (btree->type == BTREE_COL_VAR ? - __col_var_last_recno(cbt->ref) : - __col_fix_last_recno(cbt->ref))) - append = true; } /* If we don't yet have a modify structure, we'll need one. */ diff --git a/src/reconcile/rec_write.c b/src/reconcile/rec_write.c index 3bad922cd5f..a3cb6a53a09 100644 --- a/src/reconcile/rec_write.c +++ b/src/reconcile/rec_write.c @@ -3690,7 +3690,6 @@ __rec_update_las(WT_SESSION_IMPL *session, WT_RECONCILE *r, uint32_t btree_id, WT_BOUNDARY *bnd) { WT_CURSOR *cursor; - WT_CURSOR_BTREE *cbt; WT_DECL_ITEM(key); WT_DECL_RET; WT_ITEM las_addr, las_timestamp, las_value; @@ -3702,7 +3701,6 @@ __rec_update_las(WT_SESSION_IMPL *session, uint8_t *p; cursor = NULL; - cbt = &r->update_modify_cbt; WT_CLEAR(las_addr); WT_CLEAR(las_timestamp); WT_CLEAR(las_value); @@ -3803,19 +3801,14 @@ __rec_update_las(WT_SESSION_IMPL *session, las_value.size = 0; break; case WT_UPDATE_MODIFIED: - cbt->slot = slot; - WT_ERR(__wt_value_return(session, cbt, upd)); - las_value.data = cbt->iface.value.data; - las_value.size = cbt->iface.value.size; + case WT_UPDATE_STANDARD: + las_value.data = upd->data; + las_value.size = upd->size; break; case WT_UPDATE_RESERVED: WT_ASSERT(session, upd->type != WT_UPDATE_RESERVED); continue; - case WT_UPDATE_STANDARD: - las_value.data = upd->data; - las_value.size = upd->size; - break; } #ifdef HAVE_TIMESTAMPS |