From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp18.mail.ru (smtp18.mail.ru [94.100.176.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 1B4D3445320 for ; Wed, 15 Jul 2020 02:46:47 +0300 (MSK) References: <1594221263-6228-1-git-send-email-alyapunov@tarantool.org> <1594221263-6228-8-git-send-email-alyapunov@tarantool.org> From: Vladislav Shpilevoy Message-ID: <2809e4f8-86ef-dc1e-dda2-c9621ea6bbb7@tarantool.org> Date: Wed, 15 Jul 2020 01:46:45 +0200 MIME-Version: 1.0 In-Reply-To: <1594221263-6228-8-git-send-email-alyapunov@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH 07/16] tx: save preserve old tuple flag in txn_stmt List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aleksandr Lyapunov , tarantool-patches@dev.tarantool.org Thanks for the patch! On 08.07.2020 17:14, Aleksandr Lyapunov wrote: > --- > src/box/memtx_space.c | 17 +++++++++++++++++ > src/box/txn.c | 3 +++ > src/box/txn.h | 9 +++++++++ > 3 files changed, 29 insertions(+) > > diff --git a/src/box/memtx_space.c b/src/box/memtx_space.c > index 8755920..5820c40 100644 > --- a/src/box/memtx_space.c > +++ b/src/box/memtx_space.c > @@ -316,6 +316,10 @@ memtx_space_execute_replace(struct space *space, struct txn *txn, > if (stmt->new_tuple == NULL) > return -1; > tuple_ref(stmt->new_tuple); > + > + if (mode == DUP_INSERT) > + stmt->preserve_old_tuple = true; Why do you preserve old tuple in case of insert? There is no an old tuple in case of insert. Otherwise it would fail, no? > + > if (memtx_space->replace(space, NULL, stmt->new_tuple, > mode, &stmt->old_tuple) != 0) > return -1;