From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 7AF2C2B9AC for ; Tue, 16 Apr 2019 10:13:00 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F1eXI3znE6hZ for ; Tue, 16 Apr 2019 10:13:00 -0400 (EDT) Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 13B8127AD1 for ; Tue, 16 Apr 2019 10:13:00 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH 8/9] sql: make LIKE predicate return boolean result References: From: Vladislav Shpilevoy Message-ID: <851f5d59-c3ce-fea4-ecbe-463525436f8e@tarantool.org> Date: Tue, 16 Apr 2019 17:12:57 +0300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: tarantool-patches@freelists.org, Nikita Pettik Cc: kostja@tarantool.org 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'.