[Tarantool-patches] [PATCH v2 15/15] sql: remove field argv from struct sql_context

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Thu Sep 23 01:51:22 MSK 2021


Thanks for the patch!

> diff --git a/src/box/sql/func.c b/src/box/sql/func.c
> index cdfb020cb..6cbbbac74 100644
> --- a/src/box/sql/func.c
> +++ b/src/box/sql/func.c
> @@ -55,31 +55,31 @@ static struct func_sql_builtin **functions;
>  
>  /** Implementation of the SUM() function. */
>  static void
> -step_sum(struct sql_context *ctx, int argc, struct Mem **argv)
> +step_sum(struct sql_context *ctx, int argc, struct Mem *argv)

Is it a good idea? This way you force to allocate the Mem array.
But what if I have a function call like func(col1, col10, col20),
where colN are columns of a tuple? They are stored in Mems, so previously
it would be possible to pass &col1, &col10, &col20. Now you have no
choice but to allocate 3 * sizeof(Mem) and ephem-copy the mems.

How does func(col1, col10, col20) behave before this patch? Does it
copy the cols even now?


More information about the Tarantool-patches mailing list