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 CB331268F9 for ; Tue, 5 Mar 2019 04:16:19 -0500 (EST) 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 JoHuqedw4Xj7 for ; Tue, 5 Mar 2019 04:16:19 -0500 (EST) Received: from smtp46.i.mail.ru (smtp46.i.mail.ru [94.100.177.106]) (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 7B463268C2 for ; Tue, 5 Mar 2019 04:16:19 -0500 (EST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: [tarantool-patches] Re: [PATCH v3 7/9] sql: rework four semantic errors From: "n.pettik" In-Reply-To: <68603a625edc2f90ae0533b0462575e4818bb1da.1551530224.git.imeevma@gmail.com> Date: Tue, 5 Mar 2019 12:16:16 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: References: <68603a625edc2f90ae0533b0462575e4818bb1da.1551530224.git.imeevma@gmail.com> 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 > diff --git a/src/box/sql/expr.c b/src/box/sql/expr.c > index 7ea344b..ffcb455 100644 > --- a/src/box/sql/expr.c > +++ b/src/box/sql/expr.c > @@ -730,9 +730,9 @@ sqlExprCheckHeight(Parse * pParse, int nHeight) > int rc =3D SQL_OK; > int mxHeight =3D pParse->db->aLimit[SQL_LIMIT_EXPR_DEPTH]; > if (nHeight > mxHeight) { > - sqlErrorMsg(pParse, > - "Expression tree is too large (maximum = depth %d)", > - mxHeight); > + diag_set(ClientError, ER_SQL_PARSER_LIMIT, "Number of = nodes "\ > + "in expression tree", 0, "", nHeight, = mxHeight); > + pParse->is_aborted =3D true; > rc =3D SQL_ERROR; > } > return rc; > @@ -1174,9 +1174,9 @@ sqlExprAssignVarNumber(Parse * pParse, Expr * = pExpr, u32 n) > testcase(i =3D=3D SQL_BIND_PARAMETER_MAX - 1); > testcase(i =3D=3D SQL_BIND_PARAMETER_MAX); > if (!is_ok || i < 1 || i > = SQL_BIND_PARAMETER_MAX) { > - sqlErrorMsg(pParse, > - "variable number must be = between $1 and $%d", > - SQL_BIND_PARAMETER_MAX); > + diag_set(ClientError, = ER_SQL_BIND_PARAMETER_MAX, > + SQL_BIND_PARAMETER_MAX); You still can get here if i < 1. Please add an assertion here.