diff options
author | Keith Bostic <keith@wiredtiger.com> | 2014-06-14 12:18:01 -0400 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2014-06-14 12:18:01 -0400 |
commit | cb6db175060e24caf29ed7ee825eace5b705d1d1 (patch) | |
tree | 1d48e4ec2a70cf29ac77ac348a8bc00e3281a039 | |
parent | 073550619cabe04725a2c77d5aa8f0a277caa83d (diff) | |
download | mongo-cb6db175060e24caf29ed7ee825eace5b705d1d1.tar.gz |
When returning from WT_CURSOR.update, we previously called __wt_kv_return
to point the cursor at internal copies of the data. That no longer works
because we don't have a reference to the correct WT_UPDATE structure in
that code (and it's unclear to me how to get a reference to the correct
WT_UPDATE structure). As a workaround, ensure the cursor has a local copy
of the key/value pair. This is probably wrong, I'm expecting to revisit
this change once I have a better understanding of issue #1070.
-rw-r--r-- | src/btree/bt_cursor.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/btree/bt_cursor.c b/src/btree/bt_cursor.c index bacc52c476a..01805c49e3c 100644 --- a/src/btree/bt_cursor.c +++ b/src/btree/bt_cursor.c @@ -636,10 +636,17 @@ retry: WT_RET(__cursor_func_init(cbt, 1)); err: if (ret == WT_RESTART) goto retry; + /* If successful, point the cursor at internal copies of the data. */ - if (ret == 0) - ret = __wt_kv_return( - session, cbt, cbt->ins == NULL ? NULL : cbt->ins->upd); + if (ret == 0) { + if (!WT_DATA_IN_ITEM(&cursor->key)) + WT_TRET(__wt_buf_set(session, &cursor->key, + cursor->key.data, cursor->key.size)); + if (!WT_DATA_IN_ITEM(&cursor->value)) + WT_TRET(__wt_buf_set(session, &cursor->value, + cursor->value.data, cursor->value.size)); + } + if (ret != 0) WT_TRET(__cursor_error_resolve(cbt)); return (ret); |