Tarantool development patches archive
 help / color / mirror / Atom feed
* [tarantool-patches] [PATCH 0/4] Rework SQL transaction processing
@ 2018-05-03 18:49 Nikita Pettik
  2018-05-03 18:49 ` [tarantool-patches] [PATCH 1/4] sql: remove OP_AutoCommit opcode Nikita Pettik
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Nikita Pettik @ 2018-05-03 18:49 UTC (permalink / raw)
  To: tarantool-patches; +Cc: v.shpilevoy, Nikita Pettik

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

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2018-05-11 10:08 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-03 18:49 [tarantool-patches] [PATCH 0/4] Rework SQL transaction processing Nikita Pettik
2018-05-03 18:49 ` [tarantool-patches] [PATCH 1/4] sql: remove OP_AutoCommit opcode Nikita Pettik
2018-05-04 14:12   ` [tarantool-patches] " Vladislav Shpilevoy
2018-05-05 19:14     ` n.pettik
2018-05-03 18:49 ` [tarantool-patches] [PATCH 2/4] sql: allow transitive Lua <-> SQL transactions Nikita Pettik
2018-05-04 14:12   ` [tarantool-patches] " Vladislav Shpilevoy
2018-05-05 19:14     ` n.pettik
2018-05-03 18:49 ` [tarantool-patches] [PATCH 3/4] sql: allow SAVEPOINT statement outside transaction Nikita Pettik
2018-05-04 14:12   ` [tarantool-patches] " Vladislav Shpilevoy
2018-05-05 19:15     ` n.pettik
2018-05-03 18:49 ` [tarantool-patches] [PATCH 4/4] sql: fix SAVEPOINT RELEASE statement Nikita Pettik
2018-05-04 14:12   ` [tarantool-patches] " Vladislav Shpilevoy
2018-05-05 19:16     ` n.pettik
2018-05-07 13:31 ` [tarantool-patches] Re: [PATCH 0/4] Rework SQL transaction processing Vladislav Shpilevoy
2018-05-11  7:17   ` Kirill Yukhin
2018-05-11 10:08   ` Kirill Yukhin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox