[Tarantool-patches] [PATCH 07/16] tx: save preserve old tuple flag in txn_stmt

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Wed Jul 15 02:46:45 MSK 2020


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;


More information about the Tarantool-patches mailing list