From: Kirill Shcherbatov <kshcherbatov@tarantool.org> To: tarantool-patches@freelists.org, v.shpilevoy@tarantool.org Cc: Kirill Shcherbatov <kshcherbatov@tarantool.org> Subject: [tarantool-patches] [PATCH v1 0/6] sql: Checks on server side Date: Thu, 29 Nov 2018 16:09:44 +0300 [thread overview] Message-ID: <cover.1543496928.git.kshcherbatov@tarantool.org> (raw) Branch: http://github.com/tarantool/tarantool/tree/kshch/gh-3691-checks-on-server-side Issue: https://github.com/tarantool/tarantool/issues/3691 Implemented SQL Checks validations on server side. Introduced a new sql_check class containing precompiled reusable VDBE making required validations. It has been parameterized with binding parameters to map a tuple to be inserted in VDBE memory and to manage checks to be performed on UPDATE operation. To support IGNORE/FAIL/ABORT semantics for UPDATE operation fixed DML bug: The SQL UPDATE operation is consists of Delete and Insert operations. If for some reason insert operation would fail(e.g. Check constraint fire), there where no Delete rollback, so data has dissappered. Fixed this problem with VDBE error handler code that use Savepoint to cancel this Delete. Kirill Shcherbatov (6): box: rename space->opts checks to checks_ast sql: disallow use of TYPEOF in Check box: exported sql_bind structure and API sql: release OP_Idx{Insert,Replace} p2 argument sql: fix incomplete UPDATE on IdxInsert failured sql: make sql checks on server side extra/mkopcodeh.sh | 2 + src/box/alter.cc | 48 ++++++- src/box/execute.c | 48 +------ src/box/execute.h | 52 ++++++++ src/box/space.c | 10 ++ src/box/space.h | 5 + src/box/space_def.c | 15 ++- src/box/space_def.h | 4 +- src/box/sql.c | 177 +++++++++++++++++++++++++- src/box/sql.h | 66 ++++++++++ src/box/sql/build.c | 42 ++++-- src/box/sql/delete.c | 2 +- src/box/sql/expr.c | 4 +- src/box/sql/insert.c | 121 ++++++------------ src/box/sql/select.c | 33 +++-- src/box/sql/sqliteInt.h | 37 +++++- src/box/sql/update.c | 33 ++++- src/box/sql/vdbe.c | 45 +++++-- src/box/sql/vdbeInt.h | 7 + src/box/sql/vdbeapi.c | 8 -- src/box/sql/where.c | 2 +- src/box/sql/wherecode.c | 5 +- test/sql-tap/check.test.lua | 113 +++------------- test/sql-tap/fkey2.test.lua | 4 +- test/sql-tap/table.test.lua | 8 +- test/sql/checks.result | 51 ++++++++ test/sql/checks.test.lua | 18 +++ test/sql/gh-2981-check-autoinc.result | 8 +- 28 files changed, 672 insertions(+), 296 deletions(-) -- 2.19.2
next reply other threads:[~2018-11-29 13:10 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-11-29 13:09 Kirill Shcherbatov [this message] 2018-11-29 13:09 ` [tarantool-patches] [PATCH v1 1/6] box: rename space->opts checks to checks_ast Kirill Shcherbatov 2018-11-29 13:09 ` [tarantool-patches] [PATCH v1 2/6] sql: disallow use of TYPEOF in Check Kirill Shcherbatov 2018-11-29 13:09 ` [tarantool-patches] [PATCH v1 3/6] box: exported sql_bind structure and API Kirill Shcherbatov 2018-11-29 13:09 ` [tarantool-patches] [PATCH v1 4/6] sql: release OP_Idx{Insert,Replace} p2 argument Kirill Shcherbatov 2018-11-29 13:09 ` [tarantool-patches] [PATCH v1 5/6] sql: fix incomplete UPDATE on IdxInsert failured Kirill Shcherbatov 2018-11-29 13:09 ` [tarantool-patches] [PATCH v1 6/6] sql: make sql checks on server side Kirill Shcherbatov 2018-11-29 14:09 ` [tarantool-patches] " Kirill Shcherbatov 2018-11-29 18:41 ` Kirill Shcherbatov
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.1543496928.git.kshcherbatov@tarantool.org \ --to=kshcherbatov@tarantool.org \ --cc=tarantool-patches@freelists.org \ --cc=v.shpilevoy@tarantool.org \ --subject='Re: [tarantool-patches] [PATCH v1 0/6] sql: Checks on server side' \ /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