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 CCE592625C for ; Wed, 6 Feb 2019 08:21:24 -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 c3BXqM2fwkHr for ; Wed, 6 Feb 2019 08:21:24 -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 25F3620D1B for ; Wed, 6 Feb 2019 08:21:24 -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] sql: remove useless pragmas From: "n.pettik" In-Reply-To: <20190206121822.9534-1-szudin@tarantool.org> Date: Wed, 6 Feb 2019 16:21:20 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: References: <20190206121822.9534-1-szudin@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 6 Feb 2019, at 15:18, Stanislav Zudin wrote: >=20 > The pragmas "query_only" and "read_uncommitted" didn't affect anything = and were removed. Nit: please, fit commit message into 72 symbols. What about =E2=80=9Cbusy_timeout=E2=80=9D? As I see from code it is also = useless. It may require to delete some code more code. Moreover, last two arguments of index_list are still unused: 386 void 387 sql_pragma_index_list(struct Parse *parse, const char *tbl_name) 388 { ... 398 sqlite3VdbeMultiLoad(v, 1, "isisi", i, = idx->def->name, 399 idx->def->opts.is_unique); Function expects 5 args (int-string-int-string-int), but only three are = passed. Let=E2=80=99s remove them as well. Finally, consider comment from P. Gulutzan and my answer attached to = ticket. In a nutshell, at least two points (except for notes above) should be = fixed: a) Raise an error if index_list accepts name of unexisting index; b) Make sql_default_engine accept only string, not id. You may expand current patch into patch-set. > Closes #3733 > --- > Branch: = https://github.com/tarantool/tarantool/tree/stanztt/gh-3733-obsolete-pragm= as > Issue: https://github.com/tarantool/tarantool/issues/3733 >=20 > src/box/sql/pragma.h | 10 ---------- > src/box/sql/sqliteInt.h | 3 --- > 2 files changed, 13 deletions(-) >=20 > diff --git a/src/box/sql/pragma.h b/src/box/sql/pragma.h > index e60801608..6b27f83c2 100644 > --- a/src/box/sql/pragma.h > +++ b/src/box/sql/pragma.h > @@ -153,16 +153,6 @@ static const PragmaName aPragmaName[] =3D { > /* iArg: */ 0}, > #endif > #if !defined(SQLITE_OMIT_FLAG_PRAGMAS) > - { /* zName: */ "query_only", > - /* ePragTyp: */ PragTyp_FLAG, > - /* ePragFlg: */ PragFlg_Result0 | PragFlg_NoColumns1, > - /* ColNames: */ 0, 0, > - /* iArg: */ SQLITE_QueryOnly}, > - { /* zName: */ "read_uncommitted", > - /* ePragTyp: */ PragTyp_FLAG, > - /* ePragFlg: */ PragFlg_Result0 | PragFlg_NoColumns1, > - /* ColNames: */ 0, 0, Personally I would add very simple tests to make sure that these pragmas can=E2=80=99t be used anymore.