[tarantool-patches] [PATCH 0/4] Rework SQL transaction processing

Nikita Pettik korablev at tarantool.org
Thu May 3 21:49:21 MSK 2018


Branch: https://github.com/tarantool/tarantool/tree/np/rework-sql-transactions
Issue:
https://github.com/tarantool/tarantool/issues/3237
https://github.com/tarantool/tarantool/issues/3313
https://github.com/tarantool/tarantool/issues/3379


This patch-set consists of several fixes related to SQL transactions.

First patch provides slight refactoring of transactions processing
in SQL: instead of using one opcode OP_AutoCommit for BEGIN, COMMIT and
ROLLBACK handling during VDBE execution, three different opcodes are
added. Moreover, redundant switches of auto-commit flag are removed.
Now, it is set during VDBE creation and can be changed only by BEGIN
statement or by DML request (since DML must be surrounded in a separate txn).

Second patch is the main in series and introduces transitive
transactions between SQL and Lua. To implement this feature,
deferred FK counter has become attribute of transaction, and
removed from VDBE.

Last two patches fix bugs connected with SQL savepoints:
first one led to assertion fault due to wrong assert condition;
second one resulted in incorrect processing of RELEASE
statement due to obsolete SQLite code.

Nikita Pettik (4):
  sql: remove OP_AutoCommit opcode
  sql: allow transitive Lua <-> SQL transactions
  sql: allow SAVEPOINT statement outside transaction
  sql: fix SAVEPOINT RELEASE statement

 src/box/errcode.h                                |   1 +
 src/box/sql/build.c                              |  51 ++-----
 src/box/sql/fkey.c                               |  66 +++------
 src/box/sql/main.c                               |   8 +-
 src/box/sql/parse.y                              |  11 +-
 src/box/sql/pragma.c                             |   3 -
 src/box/sql/sqliteInt.h                          |  33 ++++-
 src/box/sql/status.c                             |   3 +-
 src/box/sql/vdbe.c                               | 176 ++++++++++++-----------
 src/box/sql/vdbeInt.h                            |  29 +---
 src/box/sql/vdbeapi.c                            |   4 -
 src/box/sql/vdbeaux.c                            |  83 +++++------
 src/box/txn.c                                    |  18 ++-
 src/box/txn.h                                    |  22 ++-
 test/box/misc.result                             |   1 +
 test/sql/gh-3313-savepoints-outside-txn.result   |  32 +++++
 test/sql/gh-3313-savepoints-outside-txn.test.lua |  18 +++
 test/sql/gh-3379-release-savepoints.result       |  40 ++++++
 test/sql/gh-3379-release-savepoints.test.lua     |  26 ++++
 test/sql/transitive-transactions.result          | 124 ++++++++++++++++
 test/sql/transitive-transactions.test.lua        |  67 +++++++++
 21 files changed, 555 insertions(+), 261 deletions(-)
 create mode 100644 test/sql/gh-3313-savepoints-outside-txn.result
 create mode 100644 test/sql/gh-3313-savepoints-outside-txn.test.lua
 create mode 100644 test/sql/gh-3379-release-savepoints.result
 create mode 100644 test/sql/gh-3379-release-savepoints.test.lua
 create mode 100644 test/sql/transitive-transactions.result
 create mode 100644 test/sql/transitive-transactions.test.lua

-- 
2.15.1





More information about the Tarantool-patches mailing list