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 C2FD72FD68 for ; Sat, 25 May 2019 06:44:48 -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 yUOl4feErafs for ; Sat, 25 May 2019 06:44:48 -0400 (EDT) Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (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 82D0F21CFA for ; Sat, 25 May 2019 06:44:48 -0400 (EDT) From: imeevma@tarantool.org Subject: [tarantool-patches] [PATCH v1 10/21] sql: remove SQL_RANGE errcode Date: Sat, 25 May 2019 13:44:46 +0300 Message-Id: <03b0561fb2de3379f907855c1ce2750dca9a61e8.1558780708.git.imeevma@gmail.com> In-Reply-To: References: 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: korablev@tarantool.org Cc: tarantool-patches@freelists.org Removing this error code is part of getting rid of the SQL error system. --- src/box/sql/sqlInt.h | 2 -- src/box/sql/vdbeapi.c | 10 ++-------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h index e6bd5ba..8da946a 100644 --- a/src/box/sql/sqlInt.h +++ b/src/box/sql/sqlInt.h @@ -370,8 +370,6 @@ enum sql_ret_code { SQL_TOOBIG, /** Abort due to constraint violation. */ SQL_CONSTRAINT, - /** 2nd parameter to sql_bind out of range. */ - SQL_RANGE, SQL_TARANTOOL_ERROR, /** sql_step() has another row ready. */ SQL_ROW, diff --git a/src/box/sql/vdbeapi.c b/src/box/sql/vdbeapi.c index c4891a5..c697efb 100644 --- a/src/box/sql/vdbeapi.c +++ b/src/box/sql/vdbeapi.c @@ -965,11 +965,7 @@ sql_column_origin_name(sql_stmt * pStmt, int N) */ /* * Unbind the value bound to variable i in virtual machine p. This is the - * the same as binding a NULL value to the column. If the "i" parameter is - * out of range, then SQL_RANGE is returned. Othewise 0. - * - * The error code stored in database p->db is overwritten with the return - * value in any case. + * the same as binding a NULL value to the column. */ static int vdbeUnbind(Vdbe * p, int i) @@ -977,9 +973,7 @@ vdbeUnbind(Vdbe * p, int i) Mem *pVar; assert(p != NULL); assert(p->magic == VDBE_MAGIC_RUN && p->pc < 0); - if (i < 1 || i > p->nVar) { - return SQL_RANGE; - } + assert(i > 0 && i <= p->nVar); i--; pVar = &p->aVar[i]; sqlVdbeMemRelease(pVar); -- 2.7.4