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

Kirill Yukhin kyukhin at tarantool.org
Thu Apr 25 11:58:33 MSK 2019


Hello,

On 16 Apr 02:25, Nikita Pettik wrote:
> VDBE object is used in struct sql_txn to add new autoincrement ids in
> sequence_next(). List of these ids is returned later as a query
> execution result. sql_txn is created once SQL statement is executed
> inside transaction and exists till commit or rollback. After its
> creation it contains pointer to current VDBE. Each VDBE is freed after
> statement is executed. Hence, after first SQL statement within
> transaction is executed, sql_txn will point to freed memory (dangling
> pointer). This leads to crash in the next processed statement. Fix to
> this bug is simple: we must re-assign pointer to VDBE in sql_txn before
> VDBE execution.
> 
> Closes #4157
> ---
> Branch: https://github.com/tarantool/tarantool/tree/np/gh-4157-fix-autoincrement-in-transaction
> Issue: https://github.com/tarantool/tarantool/issues/4157

I've checked your patch into 2.1 and master branches.

--
Regards, Kirill Yukhin




More information about the Tarantool-patches mailing list