Tarantool development patches archive
 help / color / mirror / Atom feed
From: "n.pettik" <korablev@tarantool.org>
To: tarantool-patches@freelists.org
Cc: szudin@tarantool.org
Subject: [tarantool-patches] Re: [PATCH] sql: remove useless pragmas
Date: Wed, 6 Feb 2019 16:21:20 +0300	[thread overview]
Message-ID: <E85549E6-2B7D-4BDA-86D1-32C7F5037B16@tarantool.org> (raw)
In-Reply-To: <20190206121822.9534-1-szudin@tarantool.org>



> On 6 Feb 2019, at 15:18, Stanislav Zudin <szudin@tarantool.org> wrote:
> 
> The pragmas "query_only" and "read_uncommitted" didn't affect anything and were removed.

Nit: please, fit commit message into 72 symbols.

What about “busy_timeout”? 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’s 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-pragmas
> Issue: https://github.com/tarantool/tarantool/issues/3733
> 
> src/box/sql/pragma.h    | 10 ----------
> src/box/sql/sqliteInt.h |  3 ---
> 2 files changed, 13 deletions(-)
> 
> 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[] = {
> 	 /* 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’t be used anymore.

  reply	other threads:[~2019-02-06 13:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-06 12:18 [tarantool-patches] " Stanislav Zudin
2019-02-06 13:21 ` n.pettik [this message]
2019-02-08 10:17   ` [tarantool-patches] " Stanislav Zudin
2019-02-08 14:03     ` n.pettik
2019-02-08 16:46       ` Stanislav Zudin
2019-02-10 22:54         ` n.pettik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E85549E6-2B7D-4BDA-86D1-32C7F5037B16@tarantool.org \
    --to=korablev@tarantool.org \
    --cc=szudin@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH] sql: remove useless pragmas' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox