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 AAB1D2B602 for ; Thu, 18 Apr 2019 13:55:44 -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 VR1TRp-pMko7 for ; Thu, 18 Apr 2019 13:55:44 -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 6B061249D5 for ; Thu, 18 Apr 2019 13:55:44 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: [tarantool-patches] Re: [PATCH 8/9] sql: make LIKE predicate return boolean result From: "n.pettik" In-Reply-To: <851f5d59-c3ce-fea4-ecbe-463525436f8e@tarantool.org> Date: Thu, 18 Apr 2019 20:55:41 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: References: <851f5d59-c3ce-fea4-ecbe-463525436f8e@tarantool.org> 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 Cc: Vladislav Shpilevoy >> 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 =3D=3D MATCH); >> + sql_result_boolean(context, res =3D=3D MATCH); >=20 > 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'. diff --git a/src/box/sql/func.c b/src/box/sql/func.c index 268a4768a..238bd8e03 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_boolean(context, res =3D=3D MATCH); + sql_result_bool(context, res =3D=3D MATCH); } =20 /* diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h index a74fa4b9e..7dbca2a63 100644 --- a/src/box/sql/sqlInt.h +++ b/src/box/sql/sqlInt.h @@ -499,7 +499,7 @@ void sql_result_int(sql_context *, int); =20 void -sql_result_boolean(sql_context *ctx, bool value); +sql_result_bool(sql_context *ctx, bool value); =20 void sql_result_int64(sql_context *, sql_int64); diff --git a/src/box/sql/vdbeInt.h b/src/box/sql/vdbeInt.h index 8e161c00c..7951ba91a 100644 --- a/src/box/sql/vdbeInt.h +++ b/src/box/sql/vdbeInt.h @@ -497,7 +497,7 @@ int sqlVdbeMemSetStr(Mem *, const char *, int, u8, = void (*)(void *)); void sqlVdbeMemSetInt64(Mem *, i64); =20 void -vdbe_mem_set_boolean(struct Mem *mem, bool value); +vdbe_mem_set_bool(struct Mem *mem, bool value); =20 #ifdef SQL_OMIT_FLOATING_POINT #define sqlVdbeMemSetDouble sqlVdbeMemSetInt64 diff --git a/src/box/sql/vdbeapi.c b/src/box/sql/vdbeapi.c index 18f7587c3..e4dad3584 100644 --- a/src/box/sql/vdbeapi.c +++ b/src/box/sql/vdbeapi.c @@ -387,9 +387,9 @@ sql_result_int(sql_context * pCtx, int iVal) } =20 void -sql_result_boolean(sql_context *ctx, bool value) +sql_result_bool(sql_context *ctx, bool value) { - vdbe_mem_set_boolean(ctx->pOut, value); + vdbe_mem_set_bool(ctx->pOut, value); } =20 void diff --git a/src/box/sql/vdbemem.c b/src/box/sql/vdbemem.c index 1590a3550..69aea5ef5 100644 --- a/src/box/sql/vdbemem.c +++ b/src/box/sql/vdbemem.c @@ -803,7 +803,7 @@ sqlVdbeMemSetInt64(Mem * pMem, i64 val) } =20 void -vdbe_mem_set_boolean(struct Mem *mem, bool value) +vdbe_mem_set_bool(struct Mem *mem, bool value) {=