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 EBFEF2DA1E for ; Sun, 12 May 2019 19:04:34 -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 K_LSCLwfhPbc for ; Sun, 12 May 2019 19:04:34 -0400 (EDT) Received: from smtp59.i.mail.ru (smtp59.i.mail.ru [217.69.128.39]) (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 58D612DA06 for ; Sun, 12 May 2019 19:04:34 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: [tarantool-patches] Re: [PATCH v3 1/3] schema: add new system space for CHECK constraints From: "n.pettik" In-Reply-To: <417a7e5d-d590-a9f1-9e4c-5490180c8689@tarantool.org> Date: Mon, 13 May 2019 02:04:30 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <3BCC24C4-8859-496A-B960-D15895D94B89@tarantool.org> References: <0cd8bbf7-adfa-f59e-b726-313700aa2b39@tarantool.org> <417a7e5d-d590-a9f1-9e4c-5490180c8689@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 > On 12 May 2019, at 18:52, Kirill Shcherbatov = wrote: >=20 >>>> tarantool> create table t2(id int primary key, constraint fk1 = foreign key(id) references t2, constraint fk1 foreign key(id) references = t2) >>>> --- >>>> - error: Constraint FK1 already exists >>>> ... >>>>=20 >>>=20 >>> And this is a bug in FK >>> https://github.com/tarantool/tarantool/issues/4183 >>=20 >> Still, we have an option to fix it: display proper error message and >> process clean-up. Please, add a mention that in scope of issue we >> should also use vdbe_emit_halt_with_presence_test for CK constraints > Can't understand what do you mean. This is a problem with incorrect = usage of > vdbe_emit_halt_with_presence_test #4183. We may introduce another one > bug beautifying this error, but should we? I don=E2=80=99t ask you to add another one bug, but ask you to file this problem to not forget to fix it when smb will implement #4183. > Although this is unrelated problem and I don't care with error would > be raised here. >=20 >>> At first, there is no way to control this state as you propose. >>=20 >> Ok, then we should come up with machinery which will allow us >> to disable CK constraints, but not other NoSQL triggers.>=20 >>> Next, disabling/enabling triggers is required for upgrade() = functionality >>> and is not a part of public API. >>=20 >> =46rom user=E2=80=99s point of view checks are constraints. AFAIR = Konstantin >> asked for a handle to disable check and foreign key constraints. > Again, what does turning checks on and off have to do with their > server integration? You broke optimisation, I suggest way (turning CK constraints on/off) to = fix that. It is not about current patch, but rather about the next one. >>> So, I've reject xfer optimization when source or destination space = has >>> ck constraints. >>=20 >> This optimisation doesn=E2=80=99t seem to be vital. On the other = hand, if we can >> use it, why not to do so? > Because in the next patch supporting this change becomes quite = expensive > and pointless, we discussed it in telegram and you agreed. Agh, AFAIR we decided to turn it on when strings of expressions are = equal. If you don=E2=80=99t really want to introduce handle disabling check = constraints now, then add FIXME comment and open an issue (sql: add handle to disable constraints). That=E2=80=99s it.