From: Kirill Shcherbatov <kshcherbatov@tarantool.org>
To: tarantool-patches@freelists.org, Nikita Pettik <korablev@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH v1 3/3] sql: dissallow bindings for DDL
Date: Thu, 6 Sep 2018 16:04:58 +0300 [thread overview]
Message-ID: <105d3104-aa3e-4834-ea31-fca817bad47e@tarantool.org> (raw)
In-Reply-To: <EDD77E8A-40A8-4417-8EFC-CE245976B3D8@tarantool.org>
> Previous two patches looks OK to me.
>> Bindings could not be used in stored ACTs because they allocate
> Nit: “AST”.
>> memory registers and makes
> Nit: “make” (or better “process").
>> assignments on parse sequentially.
> Nit: “during parsing”.
> Also, I guess problem is quite more sophisticated as it seems:
> a) For check constraint bindings really make no sense
> (I can’t come up with example how they can be used there at all).
> b) For triggers currently we don’t have proper mechanism, which
> would allow to use bindings. Original SQLite also lacks it.
> To reuse the same trigger’s body with different parameters we should
> not only be able to store it as prepared statement and substitute literals,
> but also give trigger new name.
>> Original sqlite3 did validations that persistent AST doesn't have
>> auto-assigment Varibles on triggers and checks creation.
>> On DDL integration complete we've get rid this mechanism.
> Nits: “completion”, “got rid of”.
>> Now it should be returned.
>
> Well, actually your approach is slightly different: explain that
> DDL (to be more precise - triggers and checks creation) relies on
> parse_only flag in parser. Hence, you can check it and throw an
> error during parsing.
sql: dissallow bindings for DDL
Bindings could not be used in stored ASTs because they allocate
memory registers and process assignments during parsing(temporal register
should be allocated for each variable in parse context, but it is temporal).
Original sqlite3 did validations that AST to be persisted doesn't have
auto-assigment Varibles on triggers and checks creation.
On DDL integration completion we've got rid this mechanism.
Now it should be returned.
We use flag 'parse_only' which is set by parser on compiling AST to
determine attempt to use bindings in DDL(triggers, defaults and checks
creation) that is incorrect and raise an error.
Closes #3653.
next prev parent reply other threads:[~2018-09-06 13:05 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-31 15:45 [tarantool-patches] [PATCH v1 0/3] " Kirill Shcherbatov
2018-08-31 15:45 ` [tarantool-patches] [PATCH v1 1/3] sql: fix sql_check_list_item_init double free Kirill Shcherbatov
2018-08-31 15:45 ` [tarantool-patches] [PATCH v1 2/3] sql: fix sql_*_compile functions leak on error Kirill Shcherbatov
2018-08-31 15:45 ` [tarantool-patches] [PATCH v1 3/3] sql: dissallow bindings for DDL Kirill Shcherbatov
2018-09-04 11:00 ` [tarantool-patches] " n.pettik
2018-09-06 13:04 ` Kirill Shcherbatov [this message]
2018-09-10 21:52 ` n.pettik
2018-09-11 7:21 ` Kirill Shcherbatov
2018-09-11 23:03 ` n.pettik
2018-09-13 6:13 ` Kirill Shcherbatov
2018-09-13 10:12 ` [tarantool-patches] Re: [PATCH v1 0/3] " Kirill Yukhin
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=105d3104-aa3e-4834-ea31-fca817bad47e@tarantool.org \
--to=kshcherbatov@tarantool.org \
--cc=korablev@tarantool.org \
--cc=tarantool-patches@freelists.org \
--subject='[tarantool-patches] Re: [PATCH v1 3/3] sql: dissallow bindings for DDL' \
/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