[Tarantool-patches] [PATCH v1 2/7] sql: re-introduce NUMBER and SCALAR meta-types

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Thu Aug 12 21:51:01 MSK 2021


Thanks for the patch!

> diff --git a/src/box/sql/func.c b/src/box/sql/func.c
> index 5ac5c5e56..ebb546a7f 100644
> --- a/src/box/sql/func.c
> +++ b/src/box/sql/func.c
> @@ -162,6 +162,12 @@ typeofFunc(sql_context * context, int NotUsed, sql_value ** argv)
>  {
>  	const char *z = 0;
>  	UNUSED_PARAMETER(NotUsed);
> +	if (argv[0]->type == MEM_TYPE_NULL)
> +		return mem_set_str0_static(context->pOut, "NULL");

1. This can be a part of the switch-case a few lines below.

> +	if ((argv[0]->flags & MEM_Number) != 0)
> +		return mem_set_str0_static(context->pOut, "number");
> +	if ((argv[0]->flags & MEM_Scalar) != 0)
> +		return mem_set_str0_static(context->pOut, "scalar");

2. Could you please remind me what was wrong with having type
MEM_TYPE_SCALAR and storing the actual type in another field?

>  	switch (argv[0]->type) {
>  	case MEM_TYPE_INT:
>  	case MEM_TYPE_UINT:


More information about the Tarantool-patches mailing list