diff options
author | Alex Gorrod <alexander.gorrod@mongodb.com> | 2017-08-01 16:42:49 +1000 |
---|---|---|
committer | Alex Gorrod <alexander.gorrod@mongodb.com> | 2017-08-01 16:42:49 +1000 |
commit | 835bfb21d8e67663d84a40aa4f7370a4403725a9 (patch) | |
tree | 4f5edb231524f95272f834e31461ba4e17e52903 /src/third_party/wiredtiger/src/cursor/cur_file.c | |
parent | 6300b3bd4ad9cd238a02bdb8ca681a447913f1af (diff) | |
download | mongo-835bfb21d8e67663d84a40aa4f7370a4403725a9.tar.gz |
Import wiredtiger: 2e9744d11a65c63ba7445060dc78371250f04051 from branch mongodb-3.6
ref: 6173a98979..2e9744d11a
for: 3.5.11
WT-2309 Add yields and/or sleeps in #DIAGNOSTIC mode
WT-3047 Add mode aimed at uncovering race conditions in split code
WT-3308 Add statistics tracking around yield loops
WT-3316 Add new engineering section to reference guide documentation
WT-3338 Optimize cursor modify
WT-3380 Special case 8-byte timestamps
WT-3387 Add support for a stable timestamp
WT-3389 Restructure split code to hold a split generation for the entire operation.
WT-3406 Reconciliation is choosing reserved records for writing.
WT-3410 Add developer documentation for table rename
WT-3412 Add backoff logic to the btree delete and walk yield loops
WT-3418 block manager object race
WT-3422 WiredTiger upgrading documents out of date
WT-3432 workgen needs braces around an "if" body
WT-3433 session->alter method should not be supported in read-only mode
WT-3439 lint/cleanup
WT-3440 Add a log record when starting a checkpoint
WT-3442 Coverity 1378213: false positive on diagnostic assignment.
WT-3446 Temporarily disable timestamp testing in test/checkpoint
WT-3447 test_stat_log02 can assert before table stats are printed
WT-3461 Avoid long sleeps when the system clock is adjusted
WT-3463 Add recovery of backup to test_timestamp03.py
WT-3466 Track the first commit timestamp for each transaction
WT-3467 Minor lint/cleanup
Diffstat (limited to 'src/third_party/wiredtiger/src/cursor/cur_file.c')
-rw-r--r-- | src/third_party/wiredtiger/src/cursor/cur_file.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/third_party/wiredtiger/src/cursor/cur_file.c b/src/third_party/wiredtiger/src/cursor/cur_file.c index 3b6328a2d93..b5a8e1353ca 100644 --- a/src/third_party/wiredtiger/src/cursor/cur_file.c +++ b/src/third_party/wiredtiger/src/cursor/cur_file.c @@ -275,6 +275,40 @@ err: CURSOR_UPDATE_API_END(session, ret); } /* + * __curfile_modify -- + * WT_CURSOR->modify method for the btree cursor type. + */ +static int +__curfile_modify(WT_CURSOR *cursor, WT_MODIFY *entries, int nentries) +{ + WT_CURSOR_BTREE *cbt; + WT_DECL_RET; + WT_SESSION_IMPL *session; + + cbt = (WT_CURSOR_BTREE *)cursor; + CURSOR_UPDATE_API_CALL_BTREE(cursor, session, modify, cbt->btree); + WT_ERR(__cursor_checkkey(cursor)); + + /* Check for a rational modify vector count. */ + if (nentries <= 0) + WT_ERR_MSG(session, EINVAL, + "Illegal modify vector with %d entries", nentries); + + WT_ERR(__wt_btcur_modify(cbt, entries, nentries)); + + /* + * Modify maintains a position, key and value. Unlike update, it's not + * always an internal value. + */ + WT_ASSERT(session, + F_MASK(cursor, WT_CURSTD_KEY_SET) == WT_CURSTD_KEY_INT); + WT_ASSERT(session, F_MASK(cursor, WT_CURSTD_VALUE_SET) != 0); + +err: CURSOR_UPDATE_API_END(session, ret); + return (ret); +} + +/* * __curfile_update -- * WT_CURSOR->update method for the btree cursor type. */ @@ -513,6 +547,15 @@ __curfile_create(WT_SESSION_IMPL *session, /* Underlying btree initialization. */ __wt_btcur_open(cbt); + /* + * WT_CURSOR.modify supported on 'u' value formats, but the fast-path + * through the btree code requires log file format changes, it's not + * available in all versions. + */ + if (WT_STREQ(cursor->value_format, "u") && + S2C(session)->compat_major >= WT_LOG_V2) + cursor->modify = __curfile_modify; + WT_ERR(__wt_cursor_init( cursor, cursor->internal_uri, owner, cfg, cursorp)); |