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 7E2D22A868 for ; Tue, 26 Mar 2019 14:28:25 -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 7r4P-sJ1XVZN for ; Tue, 26 Mar 2019 14:28:25 -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 182842A861 for ; Tue, 26 Mar 2019 14:28:24 -0400 (EDT) From: "n.pettik" Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_0A9A1DB4-3402-472B-BED4-6673AFB10898" Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: [tarantool-patches] Re: [PATCH v4 8/8] sql: remove sqlErrorMsg() Date: Tue, 26 Mar 2019 21:28:21 +0300 In-Reply-To: <20190326175219.GA30438@tarantool.org> References: <99f4adc61352899a83a7097b965845bafaa968ef.1552494059.git.imeevma@gmail.com> <0D9B8996-D469-498B-8D6C-AFD90C6DD35E@tarantool.org> <20190325184737.GA18346@tarantool.org> <2E9AC693-B13A-4FFD-8F0D-A3FA7AA442A3@tarantool.org> <20190326175219.GA30438@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: Imeev Mergen --Apple-Mail=_0A9A1DB4-3402-472B-BED4-6673AFB10898 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > diff --git a/src/box/sql/select.c b/src/box/sql/select.c > index e217c19..778de2c 100644 > --- a/src/box/sql/select.c > +++ b/src/box/sql/select.c > @@ -1466,25 +1466,25 @@ sql_expr_list_to_key_info(struct Parse *parse, = struct ExprList *list, int start) > /* > * Name of the connection operator, used for error messages. > */ > -static const char * > -selectOpName(int id) > +const char * > +select_op_name(int op_id) Add sql_ prefix. > { > - char *z; > - switch (id) { > + const char *op_name; IMHO don=E2=80=99t see much sense in this renaming: function is small = and straight enough to use old brief names. > + switch (op_id) { > case TK_ALL: > - z =3D "UNION ALL"; > + op_name =3D "UNION ALL"; > break; > case TK_INTERSECT: > - z =3D "INTERSECT"; > + op_name =3D "INTERSECT"; > break; > case TK_EXCEPT: > - z =3D "EXCEPT"; > + op_name =3D "EXCEPT"; > break; > default: > - z =3D "UNION"; > + op_name =3D "UNION"; > break; > } > - return z; > + return op_name; > } --Apple-Mail=_0A9A1DB4-3402-472B-BED4-6673AFB10898 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

diff --git = a/src/box/sql/select.c b/src/box/sql/select.c
index e217c19..778de2c = 100644
--- = a/src/box/sql/select.c
+++ b/src/box/sql/select.c
@@ -1466,25 +1466,25 @@ sql_expr_list_to_key_info(struct = Parse *parse, struct ExprList *list, int start)
/*
 * Name of the connection operator, used for error = messages.
 */
-static const char *
-selectOpName(int id)
+const char *
+select_op_name(int op_id)

Add sql_ prefix.

{
- char = *z;
- switch (id) = {
+ const char = *op_name;

IMHO = don=E2=80=99t see much sense in this renaming: function is small and = straight
enough to use old brief names.

+ switch = (op_id) {
case TK_ALL:
- = z =3D "UNION = ALL";
+ op_name =3D "UNION ALL";
= break;
= case = TK_INTERSECT:
- z =3D "INTERSECT";
+ = op_name =3D = "INTERSECT";
= break;
= case = TK_EXCEPT:
- z =3D "EXCEPT";
+ = op_name =3D = "EXCEPT";
= break;
= default:
- = z =3D = "UNION";
+ op_name =3D "UNION";
= break;
= }
- return = z;
+ return = op_name;
}

= --Apple-Mail=_0A9A1DB4-3402-472B-BED4-6673AFB10898--