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 D0DEF2E6C7 for ; Mon, 10 Jun 2019 09:56:43 -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 kqcBcATXkSGt for ; Mon, 10 Jun 2019 09:56:43 -0400 (EDT) Received: from smtp41.i.mail.ru (smtp41.i.mail.ru [94.100.177.101]) (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 8CBDF2E6AA for ; Mon, 10 Jun 2019 09:56:43 -0400 (EDT) From: imeevma@tarantool.org Subject: [tarantool-patches] [PATCH v1 10/28] sql: remove SQL_NOTFOUND error/status code Date: Mon, 10 Jun 2019 16:56:41 +0300 Message-Id: <1714e5bd430a533474f2eaa133b3d6883db5ec23.1560174553.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: v.shpilevoy@tarantool.org Cc: tarantool-patches@freelists.org Removing this error/status code is part of getting rid of the SQL error system. --- src/box/sql/os_unix.c | 2 +- src/box/sql/sqlInt.h | 2 -- src/box/sql/where.c | 14 ++------------ 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/box/sql/os_unix.c b/src/box/sql/os_unix.c index 18e42e5..75263e3 100644 --- a/src/box/sql/os_unix.c +++ b/src/box/sql/os_unix.c @@ -1047,7 +1047,7 @@ unixFileControl(sql_file * id, int op, void *pArg) return rc; } } - return SQL_NOTFOUND; + return -1; } /* diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h index 17033eb..5bdec67 100644 --- a/src/box/sql/sqlInt.h +++ b/src/box/sql/sqlInt.h @@ -366,8 +366,6 @@ enum sql_ret_code { SQL_NOMEM, /** Some kind of disk I/O error occurred. */ SQL_IOERR, - /** Unknown opcode in sql_file_control(). */ - SQL_NOTFOUND, /** Insertion failed because database is full. */ SQL_FULL, /** The database schema changed. */ diff --git a/src/box/sql/where.c b/src/box/sql/where.c index ab277c5..6781ab0 100644 --- a/src/box/sql/where.c +++ b/src/box/sql/where.c @@ -1526,22 +1526,14 @@ whereEqualScanEst(Parse * pParse, /* Parsing & code generating context */ assert(nEq >= 1); assert(nEq <= (int) p->key_def->part_count); - assert(pBuilder->nRecValid < nEq); - - /* If values are not available for all fields of the index to the left - * of this one, no estimate can be made. Return SQL_NOTFOUND. - */ - if (pBuilder->nRecValid < (nEq - 1)) { - return SQL_NOTFOUND; - } + assert(pBuilder->nRecValid == (nEq - 1)); rc = sqlStat4ProbeSetValue(pParse, p, &pRec, pExpr, 1, nEq - 1, &bOk); pBuilder->pRec = pRec; if (rc != 0) return rc; - if (bOk == 0) - return SQL_NOTFOUND; + assert(bOk != 0); pBuilder->nRecValid = nEq; whereKeyStats(pParse, p, pRec, 0, a); @@ -2541,8 +2533,6 @@ whereLoopAddBtreeIndex(WhereLoopBuilder * pBuilder, /* The WhereLoop factory */ pExpr->x.pList, &nOut); } - if (rc == SQL_NOTFOUND) - rc = 0; if (rc != 0) break; /* Jump out of the pTerm loop */ if (nOut) { -- 2.7.4