/**1. Please, write doxygen-style comment with right margin 66.
+ * Fill up request according to given
+ * operation type. For all cases but
+ * UPSERT argument name match names of
+ * fields of struct request. For UPSERT
+ * arguments key and key_end are fields
+ * ops and ops_end.
+ */
+memtx_space_ephemeral_replace(struct space *space, struct txn *txn,2. rc != 0
+ struct request *request, struct tuple **result)
{
- struct memtx_space *memtx_space = (struct memtx_space *)space;
- struct tuple *new_tuple = memtx_tuple_new(space->format, tuple,
- tuple_end);
- if (new_tuple == NULL)
- return -1;
- tuple_ref(new_tuple);
+ assert(txn == NULL);
+ (void)txn;
+ struct tuple *new_tuple = NULL;
struct tuple *old_tuple = NULL;
- if (memtx_space->replace(space, old_tuple, new_tuple,
- DUP_REPLACE_OR_INSERT, &old_tuple) != 0) {
+ int rc = memtx_space_replace_impl(space, request, &new_tuple,
+ &old_tuple, result);
+ if (rc && new_tuple != NULL)