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 111F0273FC for ; Fri, 8 Feb 2019 09:22:25 -0500 (EST) 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 ZYeIzUr-8szN for ; Fri, 8 Feb 2019 09:22:24 -0500 (EST) Received: from smtp61.i.mail.ru (smtp61.i.mail.ru [217.69.128.41]) (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 C3CFF24C29 for ; Fri, 8 Feb 2019 09:22:24 -0500 (EST) Received: by smtp61.i.mail.ru with esmtpa (envelope-from ) id 1gs72s-0002b7-KL for tarantool-patches@freelists.org; Fri, 08 Feb 2019 17:22:22 +0300 Date: Fri, 8 Feb 2019 17:22:22 +0300 From: Kirill Yukhin Subject: [tarantool-patches] Re: [PATCH] sql: raise err on CHECK + ON CONFLICT REPLACE Message-ID: <20190208142222.o2722hwia3qjuxpt@tarantool.org> References: <821d032b-9adf-6496-c0bc-f0f9497c5f83@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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 Hello, On 04 Feb 20:05, Ivan Koptelov wrote: > On 04/02/2019 18:28, n.pettik wrote: > > > On 4 Feb 2019, at 17:44, Ivan Koptelov [1] wrote: > > Adds error raise in case of CHECK constraint declared with ON > CONFLICT REPLACE action. Before the patch such option was > forbidden, but if a user tried to create space with such constraint, > this attempt failed silently. > > > What is more, now all on conflict actions are ignored for check > constraints. So lets simply fix parser to disallow this clause. > It is quite easy: all you need is to remove onconf rule after CHECK > keyword: > > 319 tcons ::= CHECK LP expr(E) RP onconf. > 320 {sql_add_check_constraint(pParse,&E);} > > Thank you for the idea, done. > -- > src/box/sql/parse.y | 2 +- > test/sql-tap/check.test.lua | 37 ++++++++++++++++++++++++++++++++++++- > 2 files changed, 37 insertions(+), 2 deletions(-) I've checked your patch into 2.1 branch. -- Regards, Kirill Yukhin