[tarantool-patches] Re: [PATCH 8/9] sql: make LIKE predicate return boolean result

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Tue Apr 16 17:12:57 MSK 2019



On 14/04/2019 18:04, Nikita Pettik wrote:
> According to ANSI, LIKE predicate should return boolean result.
> This patch changes type of return value of LIKE predicate.
> 
> Part of #3723
> ---
>  src/box/sql/func.c                                 | 12 ++--
>  src/box/sql/sqlInt.h                               |  3 +
>  src/box/sql/vdbeInt.h                              |  4 ++
>  src/box/sql/vdbeapi.c                              |  6 ++
>  src/box/sql/vdbemem.c                              |  8 +++
>  .../gh-3251-string-pattern-comparison.test.lua     | 76 +++++++++++-----------
>  6 files changed, 65 insertions(+), 44 deletions(-)
> 
> diff --git a/src/box/sql/func.c b/src/box/sql/func.c
> index 860cd8920..baa739ba4 100644
> --- a/src/box/sql/func.c
> +++ b/src/box/sql/func.c
> @@ -974,7 +974,7 @@ likeFunc(sql_context *context, int argc, sql_value **argv)
>  		sql_result_error(context, err_msg, -1);
>  		return;
>  	}
> -	sql_result_int(context, res == MATCH);
> +	sql_result_boolean(context, res == MATCH);

Probably we should either contract all the names,
or do not contract any. Here the name was contracted: 'int',
not 'integer'. Then it should be 'bool', not 'boolean'.




More information about the Tarantool-patches mailing list