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 8E59A2FD88 for ; Sat, 25 May 2019 06:44:41 -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 GIQ-wqTSmBgr for ; Sat, 25 May 2019 06:44:41 -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 4E55F2F902 for ; Sat, 25 May 2019 06:44:41 -0400 (EDT) From: imeevma@tarantool.org Subject: [tarantool-patches] [PATCH v1 06/21] sql: remove SQL_NOTFOUND error/status code Date: Sat, 25 May 2019 13:44:39 +0300 Message-Id: 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/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 | 13 ++----------- 3 files changed, 3 insertions(+), 14 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 d8629ab..bf1bf39 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 0b1ccd9..060dfee 100644 --- a/src/box/sql/where.c +++ b/src/box/sql/where.c @@ -1528,21 +1528,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); @@ -2542,8 +2535,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