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 B22E229F82 for ; Tue, 23 Apr 2019 15:58:53 -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 dziKXrvX8TPZ for ; Tue, 23 Apr 2019 15:58:53 -0400 (EDT) Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (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 6D62A290EA for ; Tue, 23 Apr 2019 15:58:53 -0400 (EDT) Content-Type: text/plain; charset=utf-8 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: Date: Tue, 23 Apr 2019 22:58:51 +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/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) >> { >>=20 >=20 > 1. We now have mem_value_bool(), and so as to be consistent > it would be better to name this function mem_set_bool(), not > vdbe_mem_set_bool(). It does not take struct Vdbe pointer > anyway. >=20 > 2. Is there any concrete reason why vdbe_mem_set_bool() is > not used now in the following places? No, there=E2=80=99s not. >=20 > vdbe.c:1101 > pOut =3D out2Prerelease(p, pOp); > assert(pOp->p1 =3D=3D 1 || pOp->p1 =3D=3D 0); > pOut->flags =3D MEM_Bool; > pOut->u.b =3D pOp->p1; > break; >=20 > vdbe.c:2275 > memAboutToChange(p, pOut); > MemSetTypeFlag(pOut, MEM_Bool); > pOut->u.b =3D res2; > REGISTER_TRACE(pOp->p2, pOut); >=20 > vdbe.c:2471 > pOut->u.b =3D v1; > MemSetTypeFlag(pOut, MEM_Bool); >=20 > vdbe.c:2495 > pOut->flags =3D MEM_Bool; > pOut->u.b =3D ! pIn1->u.b; >=20 > If it works for them, then I propose to move vdbe_mem_set_bool() > to the patch 'sql: introduce type boolean', and use it. Ok, added changes to corresponding patches. > Also, please, consider this minor review fix, on the branch: Applied.