From: "n.pettik" <korablev@tarantool.org>
To: tarantool-patches@freelists.org
Cc: Kirill Shcherbatov <kshcherbatov@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH v1 3/3] sql: dissallow bindings for DDL
Date: Wed, 12 Sep 2018 02:03:45 +0300 [thread overview]
Message-ID: <119B9157-8352-4256-8160-427752400D3E@tarantool.org> (raw)
In-Reply-To: <cc3a12cd-b6c1-678a-88d1-cb657d1a0a77@tarantool.org>
>> ‘''
>> Could we keep previous error message? It looks satisfactory actually.
>> The same for triggers: could we use message like
>> “Failed to create trigger ‘…’: parameters prohibited in trigger definition”?
>> Or present your persuasive arguments :)
>> ‘’’
>>
>> I ‘member that we discussed smth about error messages but really
>> can’t recall exactly what. So, please, answer on this nit or fix it.
> The previous error message was set elsewhere in other place, on resolve.
> Now this is a part of parser that doesn't now, which AST does it compile. And this
> should be done uniformly.
>
>> This test should be moved to test/sql/triggers.test.lua
>> (Since this test is about checks only).
> Ohm, okey. Separate tests per one ticket is a bigger evil for me.
> As you wish. I've fixed it.
Please, don’t forget to attach diff.
diff --git a/test/sql/checks.test.lua b/test/sql/checks.test.lua
index fb958092e..24d5ee725 100644
--- a/test/sql/checks.test.lua
+++ b/test/sql/checks.test.lua
@@ -42,12 +42,20 @@ opts = {checks = {{name = 123}}}
format = {{name = 'X', type = 'unsigned'}}
t = {513, 1, 'test', 'memtx', 0, opts, format}
s = box.space._space:insert(t)
-
-
Noise diff.
--
-- gh-3611: Segfault on table creation with check referencing this table
--
box.sql.execute("CREATE TABLE w2 (s1 INT PRIMARY KEY, CHECK ((SELECT COUNT(*) FROM w2) = 0));")
box.sql.execute("DROP TABLE w2;")
+--
+-- gh-3653: Dissallow bindings for DDL
+--
+box.sql.execute("CREATE TABLE t5(x primary key, y,CHECK( x*y<? ));")
+
+opts = {checks = {{expr = '?>5', name = 'ONE'}}}
+format = {{name = 'X', type = 'unsigned'}}
+t = {513, 1, 'test', 'memtx', 0, opts, format}
+s = box.space._space:insert(t)
+
test_run:cmd("clear filter”)
You forgot to drop table t5.
+++ b/test/sql/triggers.test.lua
@@ -155,3 +155,14 @@ box.sql.execute("UPDATE v SET s1 = s1 + 5;")
box.sql.execute("SELECT * FROM t;")
box.sql.execute("DROP VIEW v;")
box.sql.execute("DROP TABLE t;")
+
+
One new line is redundant.
The rest *obviously* LGTM.
next prev parent reply other threads:[~2018-09-11 23:03 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
2018-09-10 21:52 ` n.pettik
2018-09-11 7:21 ` Kirill Shcherbatov
2018-09-11 23:03 ` n.pettik [this message]
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=119B9157-8352-4256-8160-427752400D3E@tarantool.org \
--to=korablev@tarantool.org \
--cc=kshcherbatov@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