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 1784821E3D for ; Wed, 13 Feb 2019 02:10:45 -0500 (EST) 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 RPinjode37_P for ; Wed, 13 Feb 2019 02:10:45 -0500 (EST) Received: from smtp5.mail.ru (smtp5.mail.ru [94.100.179.24]) (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 515A51FE89 for ; Wed, 13 Feb 2019 02:10:44 -0500 (EST) Subject: [tarantool-patches] Re: [PATCH v4 2/2] sql: remove busy handler References: <20190212073151.27230-1-szudin@tarantool.org> <20190212073151.27230-2-szudin@tarantool.org> <6210D946-7927-47A2-8598-E6F9B8309641@tarantool.org> From: Stanislav Zudin Message-ID: Date: Wed, 13 Feb 2019 10:10:41 +0300 MIME-Version: 1.0 In-Reply-To: <6210D946-7927-47A2-8598-E6F9B8309641@tarantool.org> Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: 8bit Content-Language: en-US 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, "n.pettik" On 12.02.2019 20:05, n.pettik wrote: >> - * >> - * Call sqlite3_busy_timeout(db, N). Return the current >> - * timeout value * if one is set. If no busy handler >> - * or a different busy handler is set * then 0 is >> - * returned. Setting the busy_timeout to 0 or negative * >> - * disables the timeout. >> - */ >> - /* case PragTyp_BUSY_TIMEOUT */ >> default:{ >> - assert(pPragma->ePragTyp == PragTyp_BUSY_TIMEOUT); >> - if (zRight) { >> - sqlite3_busy_timeout(db, sqlite3Atoi(zRight)); >> - } >> - returnSingleInt(v, db->busyTimeout); >> - break; >> + /* We shouldn't get here. */ >> + diag_set(ClientError, ER_UNKNOWN); >> + pParse->rc = SQL_TARANTOOL_ERROR; >> + pParse->nErr++; >> + goto pragma_out; > If we really can’t reach here under no circumstances > (which seems to be true - pragmaLocate checks this) then > it’s better to place unreachable(); assert. Fix this please. Please find the fix below.  src/box/sql/pragma.c | 9 ++-------  1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/box/sql/pragma.c b/src/box/sql/pragma.c index 62ff1f2b2..1b456e0b5 100644 --- a/src/box/sql/pragma.c +++ b/src/box/sql/pragma.c @@ -643,13 +643,8 @@ sqlite3Pragma(Parse * pParse, Token * pId, /* First part of [schema.]id field */          break;      } -    default:{ -        /* We shouldn't get here. */ -        diag_set(ClientError, ER_UNKNOWN); -        pParse->rc = SQL_TARANTOOL_ERROR; -        pParse->nErr++; -        goto pragma_out; -        } +    default: +        unreachable();      }      /* The following block is a no-op unless SQLITE_DEBUG is -- 2.17.1