[Tarantool-patches] [PATCH v2 03/15] sql: remove AggStep0 and OP_BuiltinFunction0

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


Hi! Thanks for the fixes!

> diff --git a/src/box/sql/select.c b/src/box/sql/select.c
> index 92e40aef6..459325a88 100644
> --- a/src/box/sql/select.c
> +++ b/src/box/sql/select.c
> @@ -6744,3 +6749,21 @@ sql_expr_extract_select(struct Parse *parser, struct Select *select)
>  	parser->parsed_ast.expr =
>  		sqlExprDup(parser->db, expr_list->a->pExpr, 0);
>  }
> +
> +struct sql_context *
> +sql_context_new(struct Vdbe *vdbe, struct func *func, uint32_t argc)
> +{

Could you please introduce sql_context_delete() and use it where
appropriate? I am sorry I didn't notice it first time.

> +	uint32_t size = sizeof(struct sql_context);
> +	if (argc > 1)
> +		size += (argc - 1) * sizeof(struct Mem *);
> +	struct sql_context *ctx = sqlDbMallocRawNN(sql_get(), size);
> +	if (ctx == NULL)
> +		return NULL;
> +	ctx->pOut = NULL;
> +	ctx->func = func;
> +	ctx->is_aborted = false;
> +	ctx->skipFlag = 0;
> +	ctx->pVdbe = vdbe;
> +	ctx->iOp = 0;
> +	return ctx;
> +}


More information about the Tarantool-patches mailing list