[tarantool-patches] Re: [PATCH v1 3/3] sql: dissallow bindings for DDL

n.pettik korablev at tarantool.org
Wed Sep 12 02:03:45 MSK 2018


>> ‘''
>> 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.





More information about the Tarantool-patches mailing list