diff options
Diffstat (limited to 'src/include/cursor.h')
-rw-r--r-- | src/include/cursor.h | 58 |
1 files changed, 5 insertions, 53 deletions
diff --git a/src/include/cursor.h b/src/include/cursor.h index f32b4250d30..8d2f2c80c2a 100644 --- a/src/include/cursor.h +++ b/src/include/cursor.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014-2016 MongoDB, Inc. + * Copyright (c) 2014-2017 MongoDB, Inc. * Copyright (c) 2008-2014 WiredTiger, Inc. * All rights reserved. * @@ -22,8 +22,10 @@ search, \ search_near, \ insert, \ + modify, \ update, \ remove, \ + reserve, \ reconfigure, \ close) \ static const WT_CURSOR n = { \ @@ -43,8 +45,10 @@ search, \ search_near, \ insert, \ + modify, \ update, \ remove, \ + reserve, \ close, \ reconfigure, \ { NULL, NULL }, /* TAILQ_ENTRY q */ \ @@ -497,57 +501,5 @@ struct __wt_cursor_table { #define WT_CURSOR_RECNO(cursor) WT_STREQ((cursor)->key_format, "r") -/* - * WT_CURSOR_NEEDKEY, WT_CURSOR_NEEDVALUE -- - * Check if we have a key/value set. There's an additional semantic - * implemented here: if we're pointing into the tree, and about to perform - * a cursor operation, get a local copy of whatever we're referencing in - * the tree, there's an obvious race with the cursor moving and the key or - * value reference, and it's better to solve it here than in the underlying - * data-source layers. - * - * WT_CURSOR_CHECKKEY -- - * Check if a key is set without making a copy. - * - * WT_CURSOR_NOVALUE -- - * Release any cached value before an operation that could update the - * transaction context and free data a value is pointing to. - */ -#define WT_CURSOR_CHECKKEY(cursor) do { \ - if (!F_ISSET(cursor, WT_CURSTD_KEY_SET)) \ - WT_ERR(__wt_cursor_kv_not_set(cursor, true)); \ -} while (0) -#define WT_CURSOR_CHECKVALUE(cursor) do { \ - if (!F_ISSET(cursor, WT_CURSTD_VALUE_SET)) \ - WT_ERR(__wt_cursor_kv_not_set(cursor, false)); \ -} while (0) -#define WT_CURSOR_NEEDKEY(cursor) do { \ - if (F_ISSET(cursor, WT_CURSTD_KEY_INT)) { \ - if (!WT_DATA_IN_ITEM(&(cursor)->key)) \ - WT_ERR(__wt_buf_set( \ - (WT_SESSION_IMPL *)(cursor)->session, \ - &(cursor)->key, \ - (cursor)->key.data, (cursor)->key.size)); \ - F_CLR(cursor, WT_CURSTD_KEY_INT); \ - F_SET(cursor, WT_CURSTD_KEY_EXT); \ - } \ - WT_CURSOR_CHECKKEY(cursor); \ -} while (0) -#define WT_CURSOR_NEEDVALUE(cursor) do { \ - if (F_ISSET(cursor, WT_CURSTD_VALUE_INT)) { \ - if (!WT_DATA_IN_ITEM(&(cursor)->value)) \ - WT_ERR(__wt_buf_set( \ - (WT_SESSION_IMPL *)(cursor)->session, \ - &(cursor)->value, \ - (cursor)->value.data, (cursor)->value.size));\ - F_CLR(cursor, WT_CURSTD_VALUE_INT); \ - F_SET(cursor, WT_CURSTD_VALUE_EXT); \ - } \ - WT_CURSOR_CHECKVALUE(cursor); \ -} while (0) -#define WT_CURSOR_NOVALUE(cursor) do { \ - F_CLR(cursor, WT_CURSTD_VALUE_INT); \ -} while (0) - #define WT_CURSOR_RAW_OK \ (WT_CURSTD_DUMP_HEX | WT_CURSTD_DUMP_PRINT | WT_CURSTD_RAW) |