/* * __curindex_move -- * When an index cursor changes position, set the primary key in the * associated column groups and update their positions to match. */ static int __curindex_move(WT_CURSOR_INDEX *cindex) { WT_CURSOR **cp, *first; WT_SESSION_IMPL *session; u_int i; session = (WT_SESSION_IMPL *)cindex->iface.session; first = NULL; /* Point the public cursor to the key in the child. */ __wt_cursor_set_raw_key(&cindex->iface, &cindex->child->key); F_CLR(&cindex->iface, WT_CURSTD_KEY_SET | WT_CURSTD_VALUE_SET); for (i = 0, cp = cindex->cg_cursors; i < WT_COLGROUPS(cindex->table); i++, cp++) { if (*cp == NULL) continue; if (first == NULL) { /* * Set the primary key -- note that we need the primary * key columns, so we have to use the full key format, * not just the public columns. */ WT_RET(__wt_schema_project_slice(session, cp, cindex->index->key_plan, 1, cindex->index->key_format, &cindex->iface.key)); first = *cp; } else { (*cp)->key.data = first->key.data; (*cp)->key.size = first->key.size; (*cp)->recno = first->recno; } F_SET(*cp, WT_CURSTD_KEY_EXT); if (cindex->cg_needvalue[i]) WT_RET((*cp)->search(*cp)); } F_SET(&cindex->iface, WT_CURSTD_KEY_INT | WT_CURSTD_VALUE_INT); return (0); }
/* * __wt_curtable_set_value -- * WT_CURSOR->set_value implementation for tables. */ void __wt_curtable_set_value(WT_CURSOR *cursor, ...) { WT_CURSOR **cp; WT_CURSOR_TABLE *ctable; WT_DECL_RET; WT_ITEM *item, *tmp; WT_SESSION_IMPL *session; va_list ap; u_int i; ctable = (WT_CURSOR_TABLE *)cursor; JOINABLE_CURSOR_API_CALL(cursor, session, set_value, NULL); va_start(ap, cursor); if (F_ISSET(cursor, WT_CURSOR_RAW_OK | WT_CURSTD_DUMP_JSON)) { item = va_arg(ap, WT_ITEM *); cursor->value.data = item->data; cursor->value.size = item->size; ret = __wt_schema_project_slice(session, ctable->cg_cursors, ctable->plan, 0, cursor->value_format, &cursor->value); } else {