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 1A0B328785 for ; Sat, 25 May 2019 10:58:22 -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 kKFNbvlND-hG for ; Sat, 25 May 2019 10:58:22 -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 82E432727A for ; Sat, 25 May 2019 10:58:21 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: [tarantool-patches] Re: [PATCH v1 06/21] sql: remove SQL_NOTFOUND error/status code From: "n.pettik" In-Reply-To: Date: Sat, 25 May 2019 17:58:19 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <4E2824A4-6F08-4539-9954-EF9783217D54@tarantool.org> 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: tarantool-patches@freelists.org Cc: Imeev Mergen > On 25 May 2019, at 13:44, imeevma@tarantool.org wrote: >=20 > 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(-) >=20 > 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 >=3D 1); > assert(nEq <=3D (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 >=3D (nEq - 1)); Taking into consideration assert above, it could be replaced with assert(pBuilder->nRecValid =3D=3D nEq - 1); Btw, this function doesn=E2=80=99t seem to be called at all: unreachable() assert doesn=E2=80=99t fire. I can assume that it is connected with stat tables.