Skip to content
Snippets Groups Projects
Commit 2bc2286f authored by Kirill Yukhin's avatar Kirill Yukhin Committed by Kirill Yukhin
Browse files

sql: Support per-statement transactions

Introduce dedicated opcode OP_TTRansaction, which is
responsible for initiation of Tarantool transaction.
This opcode is only emitted if statement is generated
directly by parser. That means that changes like insertions
into system tables are not covered by Tarantool's transations.

Tarantool's transaction is committed or rolled back during
exectuin of `Halt` opcode. `CloseAllCursors` function was
splitted into two: in order Tarantool's WAL to work need to
preserve allocated memory until commit to WAL. Call this
deallocation after Tarantool's commit.
In future this will be re-worked since transaction can be
either in statement or generic, and not all Halts should commit.

Also, fix a bug: memory area passed to WAL were re-used. WAL itself
doesn't do memcpy, so this state of affairs was lead to unpredictable
errors during save/restore. Use region_alloc to reserve memory area
for WAL in tarantoolSqlite3Insert and tarantoolSqlite3Delete.

Closes #2599
parent e3d2485c
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment