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 3CD522797B for ; Wed, 13 Feb 2019 07:54:26 -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 UD7Wr0VN0iRV for ; Wed, 13 Feb 2019 07:54:26 -0500 (EST) Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (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 EE53E2795B for ; Wed, 13 Feb 2019 07:54:25 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: [tarantool-patches] Re: [PATCH v4 2/2] sql: remove busy handler From: "n.pettik" In-Reply-To: Date: Wed, 13 Feb 2019 15:54:22 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <0BB0EDBA-D5B7-4F39-9B44-5F2EA45973CF@tarantool.org> References: <20190212073151.27230-1-szudin@tarantool.org> <20190212073151.27230-2-szudin@tarantool.org> <6210D946-7927-47A2-8598-E6F9B8309641@tarantool.org> 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: szudin@tarantool.org > On 13 Feb 2019, at 10:10, Stanislav Zudin = wrote: > 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 =3D=3D = 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 =3D SQL_TARANTOOL_ERROR; >>> + pParse->nErr++; >>> + goto pragma_out; >> If we really can=E2=80=99t reach here under no circumstances >> (which seems to be true - pragmaLocate checks this) then >> it=E2=80=99s better to place unreachable(); assert. Fix this please. > Please find the fix below. Ok, squash it, fix remove closes #=E2=80=A6 directive from first commit message and then patch-set LGTM. >=20 > src/box/sql/pragma.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) >=20 > 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; > } >=20 > - default:{ > - /* We shouldn't get here. */ > - diag_set(ClientError, ER_UNKNOWN); > - pParse->rc =3D SQL_TARANTOOL_ERROR; > - pParse->nErr++; > - goto pragma_out; > - } > + default: > + unreachable(); > } >=20 > /* The following block is a no-op unless SQLITE_DEBUG is > --=20 > 2.17.1 >=20