From 33621eab05f101b161ae8834cb8efc3980e8f17f Mon Sep 17 00:00:00 2001 From: Luke Chen Date: Wed, 28 Aug 2019 00:23:10 +0000 Subject: Import wiredtiger: 956384325e5ff99567ea7b63b1b87b7bb62c76b8 from branch mongodb-4.4 ref: 7dfd939186..956384325e for: 4.3.1 WT-4831 Add option to python tests to not fail if stdout is not empty WT-4935 Add a perf test to find out the wiredtiger_calc_modify overhead WT-5062 Adjust the record size to consume less size WT-5063 Return proper error message for cursor modify operation for not supported cursor types --- src/third_party/wiredtiger/src/cursor/cur_ds.c | 2 +- src/third_party/wiredtiger/src/cursor/cur_file.c | 2 +- src/third_party/wiredtiger/src/cursor/cur_std.c | 29 +++++++++++++++++++++++- 3 files changed, 30 insertions(+), 3 deletions(-) (limited to 'src/third_party/wiredtiger/src/cursor') diff --git a/src/third_party/wiredtiger/src/cursor/cur_ds.c b/src/third_party/wiredtiger/src/cursor/cur_ds.c index feac9932cb4..bf90ad7238e 100644 --- a/src/third_party/wiredtiger/src/cursor/cur_ds.c +++ b/src/third_party/wiredtiger/src/cursor/cur_ds.c @@ -492,7 +492,7 @@ __wt_curds_open(WT_SESSION_IMPL *session, const char *uri, WT_CURSOR *owner, con __curds_search, /* search */ __curds_search_near, /* search-near */ __curds_insert, /* insert */ - __wt_cursor_modify_notsup, /* modify */ + __wt_cursor_modify_value_format_notsup, /* modify */ __curds_update, /* update */ __curds_remove, /* remove */ __curds_reserve, /* reserve */ diff --git a/src/third_party/wiredtiger/src/cursor/cur_file.c b/src/third_party/wiredtiger/src/cursor/cur_file.c index e73820baad7..30fe571bdbc 100644 --- a/src/third_party/wiredtiger/src/cursor/cur_file.c +++ b/src/third_party/wiredtiger/src/cursor/cur_file.c @@ -617,7 +617,7 @@ __curfile_create(WT_SESSION_IMPL *session, WT_CURSOR *owner, const char *cfg[], __curfile_search, /* search */ __curfile_search_near, /* search-near */ __curfile_insert, /* insert */ - __wt_cursor_modify_notsup, /* modify */ + __wt_cursor_modify_value_format_notsup, /* modify */ __curfile_update, /* update */ __curfile_remove, /* remove */ __curfile_reserve, /* reserve */ diff --git a/src/third_party/wiredtiger/src/cursor/cur_std.c b/src/third_party/wiredtiger/src/cursor/cur_std.c index 78d90a2bcf8..fa2b52d254d 100644 --- a/src/third_party/wiredtiger/src/cursor/cur_std.c +++ b/src/third_party/wiredtiger/src/cursor/cur_std.c @@ -102,12 +102,39 @@ __wt_cursor_equals_notsup(WT_CURSOR *cursor, WT_CURSOR *other, int *equalp) return (__wt_cursor_notsup(cursor)); } +/* + * Cursor modify operation is supported only in limited cursor types and also the modify + * operation is supported only with 'S' and 'u' value formats of the cursors. Because of + * the conditional support of cursor modify operation, To provide a better error description + * to the application whenever the cursor modify is used based on the cursor types, two + * default not supported functions are used. + * + * __wt_cursor_modify_notsup - Default function for cursor types where the modify operation + * is not supported. + * + * __wt_cursor_modify_value_format_notsup - Default function for cursor types where the modify + * operation is supported with specific value formats of the cursor. + */ + /* * __wt_cursor_modify_notsup -- * Unsupported cursor modify. */ int __wt_cursor_modify_notsup(WT_CURSOR *cursor, WT_MODIFY *entries, int nentries) +{ + WT_UNUSED(entries); + WT_UNUSED(nentries); + + return (__wt_cursor_notsup(cursor)); +} + +/* + * __wt_cursor_modify_value_format_notsup -- + * Unsupported value format for cursor modify. + */ +int +__wt_cursor_modify_value_format_notsup(WT_CURSOR *cursor, WT_MODIFY *entries, int nentries) { WT_SESSION_IMPL *session; @@ -1071,7 +1098,7 @@ __wt_cursor_init( * initialized (file cursors have a faster implementation). */ if ((WT_STREQ(cursor->value_format, "S") || WT_STREQ(cursor->value_format, "u")) && - cursor->modify == __wt_cursor_modify_notsup) + cursor->modify == __wt_cursor_modify_value_format_notsup) cursor->modify = __cursor_modify; /* -- cgit v1.2.1