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 E932E430409 for ; Sat, 22 Aug 2020 17:30:18 +0300 (MSK) References: <1fc825807e36bd97b97a28756b3e9da2c270de5b.1597417321.git.imeevma@gmail.com> From: Vladislav Shpilevoy Message-ID: <8929d59f-ef32-9bbb-0d1b-b0b4677dc877@tarantool.org> Date: Sat, 22 Aug 2020 16:30:17 +0200 MIME-Version: 1.0 In-Reply-To: <1fc825807e36bd97b97a28756b3e9da2c270de5b.1597417321.git.imeevma@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH v2 07/10] sql: move built-in function definitions in _func List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: imeevma@tarantool.org, tsafin@tarantool.org Cc: tarantool-patches@dev.tarantool.org Thanks for the patch! On 14.08.2020 17:05, imeevma@tarantool.org wrote: > This patch moves SQL built-in function definitions to _func. This helps > create an unified way to check the types of arguments. I think this all can be done by fetching more info from sql_builtins array. As I explained in one of the previous emails. > It also allows > users to see these definitions. Also, this patch enables overloading for > length(), trim(), position() and substr() functions. Tbh, I can't imagine what a monster user would need to look at these numerous flags. See no point in exposing it into _func. > diff --git a/src/box/sql/func.c b/src/box/sql/func.c > index ae1842824..1fbffa535 100644 > --- a/src/box/sql/func.c > +++ b/src/box/sql/func.c > @@ -2971,12 +2971,6 @@ func_sql_builtin_new(struct func_def *def) > func->flags = sql_builtins[idx].flags; > func->call = sql_builtins[idx].call; > func->finalize = sql_builtins[idx].finalize; > - def->param_count = sql_builtins[idx].param_count; > - def->is_deterministic = sql_builtins[idx].is_deterministic; > - def->returns = sql_builtins[idx].returns; > - def->aggregate = sql_builtins[idx].aggregate; > - def->exports.sql = sql_builtins[idx].export_to_sql; > - def->opts.has_vararg = sql_builtins[idx].param_count == -1; I think this should be extended, not removed. > return &func->base; > } >