summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/cursor/cur_table.c
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2018-02-26 17:13:06 +1100
committerLuke Chen <luke.chen@mongodb.com>2018-02-26 17:14:42 +1100
commitb5b3fcc4c38cd289e9c0d3192946ed715d7e576f (patch)
tree4b3f175a28dd1fd7bde51a1eeaa57d132ad3b54a /src/third_party/wiredtiger/src/cursor/cur_table.c
parent0a0597248fa8234414c07ec6cd5a4fef51169148 (diff)
downloadmongo-b5b3fcc4c38cd289e9c0d3192946ed715d7e576f.tar.gz
Import wiredtiger: 8f5b5544d8e2ca861956a255cf079b3ad34ca0f3 from branch mongodb-3.8
ref: a6e72378a6..8f5b5544d8 for: 3.7.3 WT-1228 Improve performance of WT_SESSION::open_cursor WT-3805 Avoid reading lookaside pages in truncate fast path WT-3829 WiredTiger metadata can be logically inconsistent. WT-3848 Enhance new prepare transaction API to enforce post conditions WT-3850 Implement WT_SESSSION::prepare_transaction WT-3867 Bi-weekly WT codebase lint WT-3901 Corruption of operation tracking log files WT-3904 Reconsider error path in log server thread WT-3905 Save the timestamp used for a checkpoint WT-3912 fast-delete pages should re-instantiate the delete transaction's timestamp. WT-3923 __wt_txn_context_prepare_check() requires API initialization WT-3925 Fix test format operation selection code WT-3926 Allow read_timestamp to be set after begin_transaction WT-3927 LSM truncate operations are too slow. WT-3932 WiredTiger memory allocation failure in js_test WT-3933 test/format failure illegal WT_REF.state rolling back deleted page
Diffstat (limited to 'src/third_party/wiredtiger/src/cursor/cur_table.c')
-rw-r--r--src/third_party/wiredtiger/src/cursor/cur_table.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/third_party/wiredtiger/src/cursor/cur_table.c b/src/third_party/wiredtiger/src/cursor/cur_table.c
index ab2382946bd..495209b7f9f 100644
--- a/src/third_party/wiredtiger/src/cursor/cur_table.c
+++ b/src/third_party/wiredtiger/src/cursor/cur_table.c
@@ -36,11 +36,13 @@ static int
__curextract_insert(WT_CURSOR *cursor)
{
WT_CURSOR_EXTRACTOR *cextract;
+ WT_DECL_RET;
WT_ITEM *key, ikey, pkey;
WT_SESSION_IMPL *session;
+ CURSOR_API_CALL(cursor, session, insert, NULL);
+
cextract = (WT_CURSOR_EXTRACTOR *)cursor;
- session = (WT_SESSION_IMPL *)cursor->session;
WT_ITEM_SET(ikey, cursor->key);
/*
@@ -49,14 +51,14 @@ __curextract_insert(WT_CURSOR *cursor)
*/
WT_ASSERT(session, ikey.size > 0);
--ikey.size;
- WT_RET(__wt_cursor_get_raw_key(cextract->ctable->cg_cursors[0], &pkey));
+ WT_ERR(__wt_cursor_get_raw_key(cextract->ctable->cg_cursors[0], &pkey));
/*
* We have the index key in the format we need, and all of the primary
* key columns are required: just append them.
*/
key = &cextract->idxc->key;
- WT_RET(__wt_buf_grow(session, key, ikey.size + pkey.size));
+ WT_ERR(__wt_buf_grow(session, key, ikey.size + pkey.size));
memcpy((uint8_t *)key->mem, ikey.data, ikey.size);
memcpy((uint8_t *)key->mem + ikey.size, pkey.data, pkey.size);
key->size = ikey.size + pkey.size;
@@ -68,7 +70,9 @@ __curextract_insert(WT_CURSOR *cursor)
F_SET(cextract->idxc, WT_CURSTD_KEY_EXT | WT_CURSTD_VALUE_EXT);
/* Call the underlying cursor function to update the index. */
- return (cextract->f(cextract->idxc));
+ ret = cextract->f(cextract->idxc);
+
+err: API_END_RET(session, ret);
}
/*
@@ -97,6 +101,8 @@ __wt_apply_single_idx(WT_SESSION_IMPL *session, WT_INDEX *idx,
__wt_cursor_notsup, /* remove */
__wt_cursor_notsup, /* reserve */
__wt_cursor_reconfigure_notsup, /* reconfigure */
+ __wt_cursor_notsup, /* cache */
+ __wt_cursor_reopen_notsup, /* reopen */
__wt_cursor_notsup); /* close */
WT_CURSOR_EXTRACTOR extract_cursor;
WT_DECL_RET;
@@ -418,7 +424,7 @@ __curtable_reset(WT_CURSOR *cursor)
WT_SESSION_IMPL *session;
ctable = (WT_CURSOR_TABLE *)cursor;
- JOINABLE_CURSOR_API_CALL(cursor, session, reset, NULL);
+ JOINABLE_CURSOR_API_CALL_PREPARE_ALLOWED(cursor, session, reset, NULL);
APPLY_CG(ctable, reset);
err: API_END_RET(session, ret);
@@ -801,7 +807,7 @@ __curtable_close(WT_CURSOR *cursor)
u_int i;
ctable = (WT_CURSOR_TABLE *)cursor;
- JOINABLE_CURSOR_API_CALL(cursor, session, close, NULL);
+ JOINABLE_CURSOR_API_CALL_PREPARE_ALLOWED(cursor, session, close, NULL);
if (ctable->cg_cursors != NULL)
for (i = 0, cp = ctable->cg_cursors;
@@ -958,6 +964,8 @@ __wt_curtable_open(WT_SESSION_IMPL *session,
__curtable_remove, /* remove */
__curtable_reserve, /* reserve */
__wt_cursor_reconfigure, /* reconfigure */
+ __wt_cursor_notsup, /* cache */
+ __wt_cursor_reopen_notsup, /* reopen */
__curtable_close); /* close */
WT_CONFIG_ITEM cval;
WT_CURSOR *cursor;