From: Kirill Shcherbatov <kshcherbatov@tarantool.org> To: tarantool-patches@freelists.org, tarantool-patches@dev.tarantool.org, kostja.osipov@gmail.com, korablev@tarantool.org Subject: [Tarantool-patches] [PATCH v1 0/9] schema: rework _trigger space Date: Mon, 14 Oct 2019 19:03:15 +0300 [thread overview] Message-ID: <cover.1571068485.git.kshcherbatov@tarantool.org> (raw) This patchset reworks structures that represent SQL triggers to inherent them from base trigger class. It is an important step to introduce a LUA persistent trigger in Tarantool as well as to support SQL triggers evaluation on the server side. In scope of this patchset the _triggers space was extended with a new fields. The _trigger space updated format is: [<name> STRING, <space_id> UINT32, <opts> MAP, <language> STR, <type> STR, <event_manipulation> STR, <action_timing> STR, <code> STR] Now trigger is produced mostly by tuple-based metadata definition instead of naive SQL request parsing. Branch: http://github.com/tarantool/tarantool/tree/kshch/gh-4343-persistent-triggers Issue: https://github.com/tarantool/tarantool/issues/4343 Kirill Shcherbatov (9): sql: remove redundant pointer in TriggerStep box: rename struct trigger to lua_trigger box: introduce trigger_event_manipulation enum box: introduce trigger_action_timing enum sql: use rlist to organize triggers in a list sql: rework CREATE TABLE rule in parser sql: wrap all ASTs in sql_trigger_expr structure sql: inherit sql_trigger from a new trigger class schema: rework _trigger system space src/box/CMakeLists.txt | 2 + src/box/alter.cc | 438 +++++++++-------- src/box/alter.h | 34 +- src/box/applier.cc | 28 +- src/box/applier.h | 2 +- src/box/bootstrap.snap | Bin 5934 -> 5981 bytes src/box/ck_constraint.c | 2 +- src/box/ck_constraint.h | 4 +- src/box/errcode.h | 1 + src/box/error.cc | 2 +- src/box/fk_constraint.c | 6 +- src/box/iproto.cc | 4 +- src/box/lua/call.c | 4 +- src/box/lua/sequence.c | 4 +- src/box/lua/space.cc | 4 +- src/box/lua/tuple.c | 2 +- src/box/lua/upgrade.lua | 16 + src/box/memtx_space.c | 8 +- src/box/recovery.cc | 2 +- src/box/relay.cc | 6 +- src/box/replication.cc | 8 +- src/box/replication.h | 4 +- src/box/schema.cc | 2 +- src/box/schema_def.h | 5 + src/box/session.cc | 4 +- src/box/session.h | 4 +- src/box/space.c | 11 +- src/box/space.h | 4 +- src/box/sql.c | 105 ++-- src/box/sql.h | 125 +++-- src/box/sql/build.c | 97 +++- src/box/sql/delete.c | 27 +- src/box/sql/fk_constraint.c | 109 +++-- src/box/sql/insert.c | 42 +- src/box/sql/parse.y | 26 +- src/box/sql/parse_def.h | 29 +- src/box/sql/prepare.c | 7 +- src/box/sql/resolve.c | 15 +- src/box/sql/sqlInt.h | 111 ++--- src/box/sql/tokenize.c | 16 +- src/box/sql/trigger.c | 448 ++++++------------ src/box/sql/update.c | 45 +- src/box/sql/vdbe.c | 18 +- src/box/trigger.c | 73 +++ src/box/trigger.h | 80 ++++ src/box/trigger_def.c | 131 +++++ src/box/trigger_def.h | 194 ++++++++ src/box/txn.c | 8 +- src/box/txn.h | 14 +- src/box/vinyl.c | 32 +- src/box/vy_lsm.c | 2 +- src/box/vy_scheduler.c | 4 +- src/box/vy_tx.c | 2 +- src/lib/core/cbus.c | 2 +- src/lib/core/fiber.c | 6 +- src/lib/core/trigger.cc | 6 +- src/lib/core/trigger.h | 20 +- src/lib/swim/swim.c | 2 +- src/lua/swim.c | 2 +- src/lua/trigger.c | 6 +- src/lua/trigger.h | 2 +- src/lua/utils.h | 2 +- src/main.cc | 4 +- test/box-py/bootstrap.result | 5 +- test/box/access_misc.result | 139 +++--- test/box/misc.result | 1 + test/sql/ddl.result | 6 +- test/sql/ddl.test.lua | 6 +- .../gh2141-delete-trigger-drop-table.result | 36 +- .../gh2141-delete-trigger-drop-table.test.lua | 4 +- test/sql/persistency.result | 36 +- test/sql/persistency.test.lua | 8 +- test/sql/triggers.result | 91 ++-- test/sql/triggers.test.lua | 30 +- test/sql/upgrade.result | 16 +- test/sql/upgrade.test.lua | 4 +- test/unit/CMakeLists.txt | 3 +- test/unit/cbus.c | 6 +- test/unit/swim.c | 14 +- test/unit/swim_test_utils.c | 6 +- 80 files changed, 1695 insertions(+), 1139 deletions(-) create mode 100644 src/box/trigger.c create mode 100644 src/box/trigger.h create mode 100644 src/box/trigger_def.c create mode 100644 src/box/trigger_def.h -- 2.23.0
next reply other threads:[~2019-10-14 16:03 UTC|newest] Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-10-14 16:03 Kirill Shcherbatov [this message] 2019-10-14 16:03 ` [Tarantool-patches] [PATCH v1 1/9] sql: remove redundant pointer in TriggerStep Kirill Shcherbatov 2019-10-15 15:35 ` [Tarantool-patches] [tarantool-patches] " Nikita Pettik 2019-10-14 16:03 ` [Tarantool-patches] [PATCH v1 2/9] box: rename struct trigger to lua_trigger Kirill Shcherbatov 2019-10-17 7:33 ` Konstantin Osipov 2019-10-14 16:03 ` [Tarantool-patches] [PATCH v1 3/9] box: introduce trigger_event_manipulation enum Kirill Shcherbatov 2019-10-17 7:35 ` Konstantin Osipov 2019-10-14 16:03 ` [Tarantool-patches] [PATCH v1 4/9] box: introduce trigger_action_timing enum Kirill Shcherbatov 2019-10-14 16:03 ` [Tarantool-patches] [PATCH v1 5/9] sql: use rlist to organize triggers in a list Kirill Shcherbatov 2019-10-17 7:36 ` Konstantin Osipov 2019-10-14 16:03 ` [Tarantool-patches] [PATCH v1 6/9] sql: rework CREATE TABLE rule in parser Kirill Shcherbatov 2019-10-14 16:03 ` [Tarantool-patches] [PATCH v1 7/9] sql: wrap all ASTs in sql_trigger_expr structure Kirill Shcherbatov 2019-10-14 16:03 ` [Tarantool-patches] [PATCH v1 8/9] sql: inherit sql_trigger from a new trigger class Kirill Shcherbatov 2019-10-17 7:38 ` Konstantin Osipov 2019-10-14 16:03 ` [Tarantool-patches] [PATCH v1 9/9] schema: rework _trigger system space Kirill Shcherbatov 2019-10-17 7:44 ` Konstantin Osipov 2019-10-15 21:34 ` [Tarantool-patches] [tarantool-patches] [PATCH v1 0/9] schema: rework _trigger space Nikita Pettik 2019-10-16 5:57 ` Konstantin Osipov 2019-10-16 5:58 ` Konstantin Osipov 2019-10-16 11:07 ` Nikita Pettik 2019-10-16 11:11 ` Konstantin Osipov 2019-10-16 12:18 ` Nikita Pettik 2019-10-16 12:32 ` Konstantin Osipov 2019-10-16 12:47 ` Nikita Pettik 2019-10-16 12:53 ` Konstantin Osipov 2019-10-16 13:13 ` Nikita Pettik 2019-10-16 14:18 ` Konstantin Osipov 2019-10-16 12:53 ` [Tarantool-patches] [tarantool-patches] " Kirill Shcherbatov 2019-10-16 13:31 ` Nikita Pettik 2019-10-16 13:47 ` Kirill Shcherbatov 2019-10-16 20:27 ` Vladislav Shpilevoy
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=cover.1571068485.git.kshcherbatov@tarantool.org \ --to=kshcherbatov@tarantool.org \ --cc=korablev@tarantool.org \ --cc=kostja.osipov@gmail.com \ --cc=tarantool-patches@dev.tarantool.org \ --cc=tarantool-patches@freelists.org \ --subject='Re: [Tarantool-patches] [PATCH v1 0/9] schema: rework _trigger space' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox