sql: recover SQL savepoints & abort
This comit introduces a number of changes: 1. move a transaction state to fiber local struct This is important because the `sqlite3` is a shared structure and it was used to store data related to the transaction. However it was working because yield is called only on commit and it garanteed unique access. (With possible effects on ddl.) NOTE: `nDeferredCons` and `nDeferredImmCons` are stored in vdbe during vdbe execution and moved to sql_txn when it needs to be saved until execution of the next vdbe in the same transaction. 2. support savepoints 2.1. support abort (anonymous savepoints) Abort mechanism was simplified. Instead of storing track of all savepoints without name, this commit introduces `anonymous_savepoint`. `anonymous_savepoint` is a structure which is stored in Vdbe and represents the state of database on the beginning of the current statement. Tarantool disallow multistatement, so a vdbe can have one statement max. That is why having one savepoint is enough to perform abort. 2.2. named savepoints Key points: - It uses Tarantool's savepoints - It allocates savepoints on the "region" (they are destroyed automatically) - There are some crutches around ddl (ddl should not be placed into a transaction) Closes #2989 #2931 #2964
Showing
- src/box/sql/build.c 0 additions, 1 deletionsrc/box/sql/build.c
- src/box/sql/main.c 4 additions, 11 deletionssrc/box/sql/main.c
- src/box/sql/pragma.c 1 addition, 5 deletionssrc/box/sql/pragma.c
- src/box/sql/sqliteInt.h 2 additions, 0 deletionssrc/box/sql/sqliteInt.h
- src/box/sql/status.c 8 additions, 5 deletionssrc/box/sql/status.c
- src/box/sql/vdbe.c 50 additions, 123 deletionssrc/box/sql/vdbe.c
- src/box/sql/vdbeInt.h 28 additions, 6 deletionssrc/box/sql/vdbeInt.h
- src/box/sql/vdbeaux.c 70 additions, 53 deletionssrc/box/sql/vdbeaux.c
- src/box/txn.c 1 addition, 0 deletionssrc/box/txn.c
- src/box/txn.h 2 additions, 0 deletionssrc/box/txn.h
Loading
Please register or sign in to comment