Tarantool development patches archive
 help / color / mirror / Atom feed
From: "n.pettik" <korablev@tarantool.org>
To: tarantool-patches@freelists.org
Cc: Imeev Mergen <imeevma@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH v3 7/9] sql: rework four semantic errors
Date: Tue, 5 Mar 2019 12:16:16 +0300	[thread overview]
Message-ID: <DCDE45C9-243D-41FA-BA97-013D561A10B8@tarantool.org> (raw)
In-Reply-To: <68603a625edc2f90ae0533b0462575e4818bb1da.1551530224.git.imeevma@gmail.com>


> 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 = SQL_OK;
> 	int mxHeight = 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 = true;
> 		rc = SQL_ERROR;
> 	}
> 	return rc;
> @@ -1174,9 +1174,9 @@ sqlExprAssignVarNumber(Parse * pParse, Expr * pExpr, u32 n)
> 			testcase(i == SQL_BIND_PARAMETER_MAX - 1);
> 			testcase(i == 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.

  parent reply	other threads:[~2019-03-05  9:16 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-02 13:07 [tarantool-patches] [PATCH v3 0/9] sql: use diag_set() for errors in SQL imeevma
2019-03-02 13:07 ` [tarantool-patches] [PATCH v3 1/9] sql: rework syntax errors imeevma
2019-03-04 17:47   ` [tarantool-patches] " n.pettik
2019-03-05  8:31   ` Konstantin Osipov
2019-03-02 13:07 ` [tarantool-patches] [PATCH v3 2/9] sql: save SQL parser errors in diag_set() imeevma
2019-03-05  8:40   ` [tarantool-patches] " Konstantin Osipov
2019-03-05  9:06   ` n.pettik
2019-03-02 13:07 ` [tarantool-patches] [PATCH v3 3/9] sql: remove field nErr of struct Parse imeevma
2019-03-05  8:41   ` [tarantool-patches] " Konstantin Osipov
2019-03-05  9:06   ` n.pettik
2019-03-02 13:07 ` [tarantool-patches] [PATCH v3 4/9] sql: remove field rc " imeevma
2019-03-05  8:42   ` [tarantool-patches] " Konstantin Osipov
2019-03-05  9:06   ` n.pettik
2019-03-02 13:07 ` [tarantool-patches] [PATCH v3 5/9] sql: remove field zErrMsg " imeevma
2019-03-05  8:43   ` [tarantool-patches] " Konstantin Osipov
2019-03-05  9:06   ` n.pettik
2019-03-02 13:07 ` [tarantool-patches] [PATCH v3 6/9] sql: rework six syntax errors imeevma
2019-03-05  8:45   ` [tarantool-patches] " Konstantin Osipov
2019-03-05  9:07   ` n.pettik
2019-03-02 13:08 ` [tarantool-patches] [PATCH v3 7/9] sql: rework four semantic errors imeevma
2019-03-05  8:46   ` [tarantool-patches] " Konstantin Osipov
2019-03-05  9:16   ` n.pettik [this message]
2019-03-02 13:08 ` [tarantool-patches] [PATCH v3 8/9] sql: rework three errors of "unsupported" type imeevma
2019-03-05  8:47   ` [tarantool-patches] " Konstantin Osipov
2019-03-05  9:34   ` n.pettik
2019-03-05  9:43     ` Konstantin Osipov
2019-03-02 13:08 ` [tarantool-patches] [PATCH v3 9/9] sql: remove sqlErrorMsg() imeevma
2019-03-05  8:48   ` [tarantool-patches] " Konstantin Osipov
2019-03-05 12:16   ` n.pettik
2019-03-05 15:44     ` Konstantin Osipov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DCDE45C9-243D-41FA-BA97-013D561A10B8@tarantool.org \
    --to=korablev@tarantool.org \
    --cc=imeevma@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH v3 7/9] sql: rework four semantic errors' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox