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 03EB221AFC for ; Wed, 20 Mar 2019 08:59:27 -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 rzd9d84Aaaaw for ; Wed, 20 Mar 2019 08:59:26 -0400 (EDT) Received: from smtp43.i.mail.ru (smtp43.i.mail.ru [94.100.177.103]) (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 AE5031FF63 for ; Wed, 20 Mar 2019 08:59:26 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.0 \(3445.100.39\)) Subject: [tarantool-patches] Re: [PATCH 1/2] sql: rename instr to position & add collation usage From: "i.koptelov" In-Reply-To: <2f6396ca10b94874467361e482555b225d5256de.1553078164.git.ivan.koptelov@tarantool.org> Date: Wed, 20 Mar 2019 15:59:23 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: References: <2f6396ca10b94874467361e482555b225d5256de.1553078164.git.ivan.koptelov@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: "n.pettik" Sorry, I have missed one case. (already squashed): --- src/box/sql/expr.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/box/sql/expr.c b/src/box/sql/expr.c index 53926e3f2..8c1889d8a 100644 --- a/src/box/sql/expr.c +++ b/src/box/sql/expr.c @@ -4102,8 +4102,16 @@ sqlExprCodeTarget(Parse * pParse, Expr * pExpr, = int target) * is done using ANSI rules from * collations_check_compatibility(). */ + if (nFarg =3D=3D 1) { + bool unused; + uint32_t id; + if (sql_expr_coll(pParse, + pFarg->a[0].pExpr, = &unused, + &id, &coll) !=3D 0) + return 0; + } if ((pDef->funcFlags & SQL_FUNC_NEEDCOLL) !=3D 0 = && - coll =3D=3D NULL) { + coll =3D=3D NULL && nFarg > 1) { struct coll *unused =3D NULL; uint32_t curr_id =3D COLL_NONE; bool is_curr_forced =3D false; --=20 2.20.=