From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 872E441D0BD for ; Wed, 16 Oct 2019 21:08:50 +0300 (MSK) Date: Wed, 16 Oct 2019 21:08:49 +0300 From: Nikita Pettik Message-ID: <20191016180849.GA23167@tarantool.org> References: <20191015151557.GA93939@tarantool.org> <05b1f332-97a2-787e-a231-c1b1cf4fffd1@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <05b1f332-97a2-787e-a231-c1b1cf4fffd1@tarantool.org> Subject: Re: [Tarantool-patches] [tarantool-patches] Re: [PATCH v4 4/4] sql: use name instead of function pointer for UDF List-Id: Tarantool development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kirill Shcherbatov Cc: tarantool-patches@freelists.org, tarantool-patches@dev.tarantool.org On 16 Oct 16:51, Kirill Shcherbatov wrote: > > Something is wrong with this test case. Firstly, it works fine > > even on master branch. Secondly, I've dropped myfunc = nil and > > got the same error (on master as well) - i.e. INSERT fails with > > 'procedure is not defined' error even if function is not dropped. > > Obviously, to make it crash on master you should drop function > > before insertion; to fix second problem you should uppercase function's > > name. > You are right. A fixed test case is below. > > +-- > +-- gh-4176: Can't recover if check constraint involves function. > +-- > +function myfunc(x) return x < 10 end Still name is not upper-cased. Fixed and pushed. > +box.schema.func.create('MYFUNC', {param_list = {'integer'}, returns = 'integer', is_deterministic = true, exports = {'LUA', 'SQL'}}) > +box.execute("CREATE TABLE t6(a INT CHECK (myfunc(a)) primary key);"); > +box.func.MYFUNC:drop() > +box.execute("INSERT INTO t6 VALUES(11);"); > +box.execute("DROP TABLE t6") > + > test_run:cmd("clear filter")