[tarantool-patches] Re: [PATCH] sql: update ptr to VDBE after its creation in sql_txn

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Thu Apr 18 23:06:47 MSK 2019



On 18/04/2019 22:20, n.pettik wrote:
> 
>>> diff --git a/test/sql/transitive-transactions.result b/test/sql/transitive-transactions.result
>>> index 883cc00f6..ee9b4218d 100644
>>> --- a/test/sql/transitive-transactions.result
>>> +++ b/test/sql/transitive-transactions.result
>>> @@ -134,3 +134,31 @@ box.execute('DROP TABLE parent;');
>>> ---
>>> - row_count: 1
>>> ...
>>> +-- gh-4157: autoincrement within transaction started in SQL
>>> +-- leads to seagfault.
>>> +--
>>> +box.execute('CREATE TABLE t (id INT PRIMARY KEY AUTOINCREMENT);');
>>> +---
>>> +- row_count: 1
>>> +...
>>> +box.execute('START TRANSACTION')
>>> +box.execute('INSERT INTO t VALUES (null), (null);')
>>> +box.execute('INSERT INTO t VALUES (null), (null);')
>>> +box.execute('SAVEPOINT sp;')
>>> +box.execute('INSERT INTO t VALUES (null);')
>>> +box.execute('ROLLBACK TO sp;')
>>> +box.execute('INSERT INTO t VALUES (null);')
>>> +box.commit();
>>> +---
>>> +...
>>> +box.space.T:select();
>>> +---
>>> +- - [1]
>>> +  - [2]
>>> +  - [3]
>>> +  - [4]
>>> +  - [6]
>>> +...
>>> +box.space.T:drop();
>>
>> Why so huge test? I see that you have 4-line test in
>> the issue. Maybe it would be simpler to use it? In the
>> test above savepoints confuse me.
> 
> As test cases shows - we don’t have tests involving insertions
> to auto-increment field within transaction. So, I just wanted to
> make sure that savepoints are working as well. If you wan’t,
> I can make this test be 2-lines-like. 

If this test works as well, it is up to you.

LGTM anyway.




More information about the Tarantool-patches mailing list