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 6D0642673A for ; Tue, 20 Aug 2019 09:47:53 -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 SwKKMxCjXHsV for ; Tue, 20 Aug 2019 09:47:53 -0400 (EDT) Received: from smtp50.i.mail.ru (smtp50.i.mail.ru [94.100.177.110]) (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 0B20D26646 for ; Tue, 20 Aug 2019 09:47:52 -0400 (EDT) Date: Tue, 20 Aug 2019 16:47:50 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH v3 7/9] sql: get rid of FuncDef function hash Message-ID: <20190820134750.GA12831@atlas> References: <20190816140902.GC18643@atlas> <52e011b5-fe1c-6731-2726-c7d2d3f65e05@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52e011b5-fe1c-6731-2726-c7d2d3f65e05@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: Kirill Shcherbatov Cc: tarantool-patches@freelists.org, korablev@tarantool.org * Kirill Shcherbatov [19/08/19 18:55]: > src/box/alter.cc | 6 + > index 4f2e34bf0..22d3040ef 100644 > --- a/src/box/alter.cc > +++ b/src/box/alter.cc > @@ -2926,6 +2926,12 @@ on_replace_dd_func(struct trigger * /* trigger */, void *event) > (unsigned) old_func->def->uid, > "function has references"); > } > + /* Can't' drop a builtin function. */ > + if (old_func->def->language == FUNC_LANGUAGE_SQL_BUILTIN) { > + tnt_raise(ClientError, ER_DROP_FUNCTION, > + (unsigned) old_func->def->uid, > + "function is SQL builtin"); > + } I remember we discussed a safety net which adds a flag "is_persistent" to sql_func_builtin, asserts this flag is set whenever the function is used in SQL, and sets this flag in alter.cc on_replace trigger. this safety net can go in a separate patch. Otherwise lgtm. -- Konstantin Osipov, Moscow, Russia