[Tarantool-patches] [PATCH v1 4/7] sql: remove unnecessary calls of OP_ApplyType

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Thu Aug 5 01:26:25 MSK 2021


Thanks for the patch!

> diff --git a/src/box/sql/wherecode.c b/src/box/sql/wherecode.c
> index 96bcab110..92d374200 100644
> --- a/src/box/sql/wherecode.c
> +++ b/src/box/sql/wherecode.c

<...>

> -/**
> - * Expression @rhs, which is the RHS of a comparison operation, is
> - * either a vector of n elements or, if n==1, a scalar expression.
> - * Before the comparison operation, types @types are to be applied
> - * to the @rhs values. This function modifies entries within the
> - * field sequence to SCALAR if either:
> - *
> - *   * the comparison will be performed with no type, or
> - *   * the type change in @types is guaranteed not to change the value.
> - */
> -static void
> -expr_cmp_update_rhs_type(struct Expr *rhs, int n, enum field_type *types)
> -{
> -	for (int i = 0; i < n; i++) {
> -		Expr *p = sqlVectorFieldSubexpr(rhs, i);
> -		enum field_type expr_type = sql_expr_type(p);
> -		if (sql_type_result(expr_type, types[i]) == FIELD_TYPE_SCALAR ||
> -		    sql_expr_needs_no_type_change(p, types[i])) {

sql_expr_needs_no_type_change is now unused.


More information about the Tarantool-patches mailing list