summaryrefslogtreecommitdiff
path: root/src/btree/bt_ret.c
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2013-07-26 10:56:22 +1000
committerMichael Cahill <michael.cahill@wiredtiger.com>2013-07-26 10:56:22 +1000
commitdbc0b587d8e074adae672e7a9bcafa04fb7bc259 (patch)
tree5f5c2667def5ecb0449f1b3a667c59b8f6834154 /src/btree/bt_ret.c
parenta83f22e48870bdc3d341db0690a263ac1288f5ef (diff)
downloadmongo-dbc0b587d8e074adae672e7a9bcafa04fb7bc259.tar.gz
Add logging for transaction commits.
Diffstat (limited to 'src/btree/bt_ret.c')
-rw-r--r--src/btree/bt_ret.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/btree/bt_ret.c b/src/btree/bt_ret.c
index 7b7baaebb9f..fc072183889 100644
--- a/src/btree/bt_ret.c
+++ b/src/btree/bt_ret.c
@@ -8,6 +8,46 @@
#include "wt_internal.h"
/*
+ * __wt_key_get --
+ * Get a reference to the current key.
+ */
+int
+__wt_key_get(WT_CURSOR_BTREE *cbt, WT_ITEM *key, uint64_t *recnop)
+{
+ WT_PAGE *page;
+ WT_ROW *rip;
+ WT_SESSION_IMPL *session;
+
+ session = (WT_SESSION_IMPL *)cbt->iface.session;
+ page = cbt->page;
+
+ switch (page->type) {
+ case WT_PAGE_COL_FIX:
+ case WT_PAGE_COL_VAR:
+ *recnop = cbt->recno;
+ break;
+ case WT_PAGE_ROW_LEAF:
+ rip = &page->u.row.d[cbt->slot];
+
+ /*
+ * If the cursor references a WT_INSERT item, take the key from
+ * there. Otherwise, take the key from the original page, and
+ * the value from any related WT_UPDATE item, or the page if
+ * the key was never updated.
+ */
+ if (cbt->ins != NULL) {
+ key->data = WT_INSERT_KEY(cbt->ins);
+ key->size = WT_INSERT_KEY_SIZE(cbt->ins);
+ } else
+ WT_RET(__wt_row_leaf_key(session, page, rip, key, 0));
+ break;
+ WT_ILLEGAL_VALUE(session);
+ }
+
+ return (0);
+}
+
+/*
* __wt_kv_return --
* Return a page referenced key/value pair to the application.
*/