Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: imeevma@tarantool.org, tsafin@tarantool.org
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v2 07/10] sql: move built-in function definitions in _func
Date: Sat, 22 Aug 2020 16:30:17 +0200	[thread overview]
Message-ID: <8929d59f-ef32-9bbb-0d1b-b0b4677dc877@tarantool.org> (raw)
In-Reply-To: <1fc825807e36bd97b97a28756b3e9da2c270de5b.1597417321.git.imeevma@gmail.com>

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;
>  }
>  

  reply	other threads:[~2020-08-22 14:30 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-14 15:04 [Tarantool-patches] [PATCH v2 00/10] sql: properly check arguments types of built-in functions imeevma
2020-08-14 15:04 ` [Tarantool-patches] [PATCH v2 01/10] sql: do not return UNSIGNED in " imeevma
2020-08-22 14:23   ` Vladislav Shpilevoy
2020-08-14 15:04 ` [Tarantool-patches] [PATCH v2 02/10] sql: fix functions return types imeevma
2020-08-22 14:24   ` Vladislav Shpilevoy
2020-08-14 15:04 ` [Tarantool-patches] [PATCH v2 03/10] sql: change signature of trim() imeevma
2020-08-22 14:26   ` Vladislav Shpilevoy
2020-08-14 15:04 ` [Tarantool-patches] [PATCH v2 04/10] box: add new options for functions imeevma
2020-08-22 14:28   ` Vladislav Shpilevoy
2020-08-14 15:05 ` [Tarantool-patches] [PATCH v2 05/10] sql: use has_vararg for built-in functions imeevma
2020-08-14 15:05 ` [Tarantool-patches] [PATCH v2 06/10] sql: add overloaded versions of the functions imeevma
2020-08-22 14:29   ` Vladislav Shpilevoy
2020-08-14 15:05 ` [Tarantool-patches] [PATCH v2 07/10] sql: move built-in function definitions in _func imeevma
2020-08-22 14:30   ` Vladislav Shpilevoy [this message]
2020-08-14 15:05 ` [Tarantool-patches] [PATCH v2 08/10] box: add param_list to 'struct func' imeevma
2020-08-22 14:30   ` Vladislav Shpilevoy
2020-08-14 15:05 ` [Tarantool-patches] [PATCH v2 09/10] sql: check built-in functions argument types imeevma
2020-08-14 15:05 ` [Tarantool-patches] [PATCH v2 10/10] sql: refactor sql/func.c imeevma
2020-08-22 14:31   ` Vladislav Shpilevoy
2020-08-22 14:25 ` [Tarantool-patches] [PATCH v2 00/10] sql: properly check arguments types of built-in functions Vladislav Shpilevoy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8929d59f-ef32-9bbb-0d1b-b0b4677dc877@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=imeevma@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=tsafin@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v2 07/10] sql: move built-in function definitions in _func' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox