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 DAF9A29AD4 for ; Tue, 19 Mar 2019 05:41:46 -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 NYPOfvjSd157 for ; Tue, 19 Mar 2019 05:41:46 -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 0FCFB299B9 for ; Tue, 19 Mar 2019 05:41:45 -0400 (EDT) From: "n.pettik" Message-Id: <0F6143F5-8CAC-493C-9D95-50DC30816A46@tarantool.org> Content-Type: multipart/alternative; boundary="Apple-Mail=_2D9E9F14-13FF-423C-808A-F103AD8B9B6A" Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: [tarantool-patches] Re: [PATCH v4 2/8] sql: set SQL parser errors via diag_set() Date: Tue, 19 Mar 2019 12:41:42 +0300 In-Reply-To: <20190318150616.GA20715@tarantool.org> References: <3be89ad14633e9b03c01200ee3d1b3c6776fccc5.1552494059.git.imeevma@gmail.com> <21543710-C2CB-4818-AE87-FA1BE3AEB0A4@tarantool.org> <20190318150616.GA20715@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=_2D9E9F14-13FF-423C-808A-F103AD8B9B6A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 >>> diff --git a/src/box/sql/tokenize.c b/src/box/sql/tokenize.c >>> index 58685c4..834c165 100644 >>> --- a/src/box/sql/tokenize.c >>> +++ b/src/box/sql/tokenize.c >>> @@ -483,7 +483,9 @@ sqlRunParser(Parse * pParse, const char *zSql, = char **pzErrMsg) >>> &pParse->sLastToken.isReserved); >>> i +=3D pParse->sLastToken.n; >>> if (i > mxSqlLen) { >>> - pParse->rc =3D SQL_TOOBIG; >>> + diag_set(ClientError, ER_SQL_PARSER_GENERIC, >>> + "string or blob too big=E2=80=9D); >>=20 >> I would add to error message max possible length. >>=20 > I will add this change in review fix of patch > "sql: rework semantic errors". Btw I wasn't able to reproduce this > error due to limit being too big. So I got an error: > "error: not enough memory". Due to this I didn't create test for > this error. This error is an indication that ssmth went really wrong. Please, investigate this bug or open an issue. This patch itself LGTM. --Apple-Mail=_2D9E9F14-13FF-423C-808A-F103AD8B9B6A Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
diff --git = a/src/box/sql/tokenize.c b/src/box/sql/tokenize.c
index = 58685c4..834c165 100644
--- a/src/box/sql/tokenize.c
+++ b/src/box/sql/tokenize.c
@@ -483,7 +483,9 = @@ sqlRunParser(Parse * pParse, const char *zSql, char **pzErrMsg)
          &nb= sp; &pParse->sLastToken.isReserved);
    i +=3D pParse->sLastToken.n;
    if (i > mxSqlLen) {
- =       pParse->rc =3D SQL_TOOBIG;
+       diag_set(ClientError, = ER_SQL_PARSER_GENERIC,
+ =          "string or blob = too big=E2=80=9D);

I would add = to error message max possible length.

I will add this change in review fix of patch
"sql: rework semantic errors". = Btw I wasn't able to reproduce this
error due to limit being too big. So I got an = error:
"error: not = enough memory". Due to this I didn't create test for
this error.

This error = is an indication that ssmth went really wrong.
Please, = investigate this bug or open an issue.

This= patch itself LGTM.

= --Apple-Mail=_2D9E9F14-13FF-423C-808A-F103AD8B9B6A--