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

Aleksandr Lyapunov alyapunov at tarantool.org
Wed Jul 15 10:53:02 MSK 2020


Hi, thanks for review!
On 15.07.2020 02:46, Vladislav Shpilevoy wrote:

> +
>> +	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?

This means that old_tuple (old value with the same key as new_tuple)
must remain NULL up to the moment when this TX is committed.

I made a comment about it.

>
>> +
>>   	if (memtx_space->replace(space, NULL, stmt->new_tuple,
>>   				 mode, &stmt->old_tuple) != 0)
>>   		return -1;


More information about the Tarantool-patches mailing list