[Tarantool-patches] [PATCH v2 07/10] sql: move built-in function definitions in _func

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Sat Aug 22 17:30:17 MSK 2020


Thanks for the patch!

On 14.08.2020 17:05, imeevma at 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;
>  }
>  


More information about the Tarantool-patches mailing list