From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 168612A966 for ; Tue, 11 Sep 2018 19:03:54 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iuQOFQ8xx1R6 for ; Tue, 11 Sep 2018 19:03:54 -0400 (EDT) Received: from smtp43.i.mail.ru (smtp43.i.mail.ru [94.100.177.103]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 5B5C428BF3 for ; Tue, 11 Sep 2018 19:03:51 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: [tarantool-patches] Re: [PATCH v1 3/3] sql: dissallow bindings for DDL From: "n.pettik" In-Reply-To: Date: Wed, 12 Sep 2018 02:03:45 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <119B9157-8352-4256-8160-427752400D3E@tarantool.org> References: <5049d3e7b70b7091c51ac99fc64f14a07c879c8a.1535730218.git.kshcherbatov@tarantool.org> <105d3104-aa3e-4834-ea31-fca817bad47e@tarantool.org> <661DC330-826B-41DC-A729-BBA9677CAD06@tarantool.org> Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: tarantool-patches@freelists.org Cc: Kirill Shcherbatov >> =E2=80=98'' >> Could we keep previous error message? It looks satisfactory actually. >> The same for triggers: could we use message like >> =E2=80=9CFailed to create trigger =E2=80=98=E2=80=A6=E2=80=99: = parameters prohibited in trigger definition=E2=80=9D? >> Or present your persuasive arguments :) >> =E2=80=98=E2=80=99=E2=80=99 >>=20 >> I =E2=80=98member that we discussed smth about error messages but = really >> can=E2=80=99t 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=20 > should be done uniformly. >=20 >> 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=E2=80=99t 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 =3D {checks =3D {{name =3D 123}}} format =3D {{name =3D 'X', type =3D 'unsigned'}} t =3D {513, 1, 'test', 'memtx', 0, opts, format} s =3D 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) =3D 0));") box.sql.execute("DROP TABLE w2;") =20 +-- +-- gh-3653: Dissallow bindings for DDL +-- +box.sql.execute("CREATE TABLE t5(x primary key, y,CHECK( x*y5', name =3D 'ONE'}}} +format =3D {{name =3D 'X', type =3D 'unsigned'}} +t =3D {513, 1, 'test', 'memtx', 0, opts, format} +s =3D box.space._space:insert(t) + test_run:cmd("clear filter=E2=80=9D) You forgot to drop table t5. +++ b/test/sql/triggers.test.lua @@ -155,3 +155,14 @@ box.sql.execute("UPDATE v SET s1 =3D 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.