From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (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 83FE544643B for ; Mon, 28 Sep 2020 23:07:53 +0300 (MSK) References: <66362762-8791-bea3-745f-afc1e3eaa199@tarantool.org> <20200928181913.GD14909@tarantool.org> From: Vladislav Shpilevoy Message-ID: <85c30425-ae7f-b485-4be5-dcad0b1c1cb6@tarantool.org> Date: Mon, 28 Sep 2020 22:07:50 +0200 MIME-Version: 1.0 In-Reply-To: <20200928181913.GD14909@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-discussions] SQL built-in functions position List-Id: Tarantool development process List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nikita Pettik , Mergen Imeev Cc: tarantool-discussions@dev.tarantool.org Hi! See my response in another email with 4 big reasons why storage of SQL-specific functions in _func is a bad idea. Also see responses on your comments in separate sections. I leave references below. On 28.09.2020 20:19, Nikita Pettik wrote: > On 27 Sep 18:18, Mergen Imeev wrote: >> Hi all. I have a question that I would like to discuss. >> >> The question is about SQL built-in functions. At the moment these functions >> are >> partially described in _func and partially in src/box/sql/func.c. I received >> two >> completely different suggestions from my reviewers on what to do with these >> functions: >> 1) Move definitions completely to _func. Remove definitions from func.c. > > That's my proposal. It makes name collisions check simple, See "## Built-in functions prevent duplicates in _func?". > provides unified interface to invoke built-in and non-built-in functions, See "## Storage in _func unifies functions?". > allows to grant and verify priveleges in the same way and so forth. See "## Built-in functions require privileges?". > Built-ins are already declaraed in _func, so reverting this thing would result> in another one unnecessary schema change and upgrade (so I doubt that implementation would > be somehow 'simpler'). See "## Storage in _func does not change _func schema and documentation?". > Finally part of functions can turn out to be really > usefull in Lua someday such as date()/time(). See "## Reuse SQL functions in Lua and other languages?". > So to me the choice is kind > of obvious.. It still is not to me.