Tarantool development patches archive
 help / color / mirror / Atom feed
From: "n.pettik" <korablev@tarantool.org>
To: "N. Tatunov" <hollow653@gmail.com>
Cc: tarantool-patches@freelists.org
Subject: [tarantool-patches] Re: [PATCH 2/2] sql: statistics removal after dropping an index
Date: Thu, 5 Apr 2018 21:01:48 +0300	[thread overview]
Message-ID: <926E041C-FCCB-46B0-B49B-21292CB70813@tarantool.org> (raw)
In-Reply-To: <CAEi+_ar9jpqcJF25DyoajMDaYaH3S9_gEWXKO1dikpNz6NKw5Q@mail.gmail.com>

Hello.

See 2 minor remarks. The rest seems to be OK.

I have noticed, that there are wrong indentations on your branch:

@@ -2415,7 +2426,7 @@ sqlite3DropTable(Parse * pParse, SrcList * pName, int isView, int noErr)
 	 */
 
 	sqlite3BeginWriteOperation(pParse, 1);
-	sqlite3ClearStatTables(pParse, "tbl", pTab->zName);
+    sql_clear_stat_tables(pParse, pTab->zName, NULL); 

@@ -3417,7 +3428,7 @@ sqlite3DropIndex(Parse * pParse, SrcList * pName, Token * pName2, int ifExists)
 	 * But firstly, delete statistics since schema
 	 * changes after DDL.
 	 */
-	sqlite3ClearStatTables(pParse, "idx", pIndex->zName);
+    sql_clear_stat_tables(pParse, pIndex->pTable->zName, pIndex->zName);

Please, fix them.

> On 4 Apr 2018, at 19:34, Hollow111 <hollow653@gmail.com> wrote:
> 
> @@ -2210,16 +2210,17 @@ sqliteViewResetAll(sqlite3 * db)
>   * Remove entries from the _sql_statN tables (for N in (1, 4))
>   * after a DROP INDEX or DROP TABLE command.
>   * 
> - * @param table_name table to be dropped or
> - *                   the table that contains index to be dropped
> - * @param idx_name index to be dropped
> + * @param parse      The parsing context.
> + * @param table_name The table to be dropped or
> + *                   the table that contains index to be dropped.
> + * @param idx_name   Index to be dropped.
>   */
>  static void
> -sql_clear_stat_tables(Parse *parse,
> -               const char *table_name,
> -		       const char *idx_name)
> +sql_clear_stat_tables(Parse *parse, const char *table_name, 
> +                      const char *idx_name
> +                     )

This bracket should be on previous line.

>  {
> -    if(idx_name) {
> +    if(idx_name != NULL) {
>          sqlite3NestedParse(parse,
>                      "DELETE FROM \"_sql_stat1\" WHERE (\"idx\"=%Q AND "
>                      "\"tbl\"=%Q)",
>  

  reply	other threads:[~2018-04-05 18:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-03 21:37 [tarantool-patches] " N.Tatunov
2018-04-04 14:06 ` [tarantool-patches] " n.pettik
2018-04-04 15:46   ` Hollow111
2018-04-04 16:11     ` n.pettik
2018-04-04 16:34       ` Hollow111
2018-04-05 18:01         ` n.pettik [this message]
     [not found]           ` <CAEi+_aq5oyeB0cbnxAXXjQqu=h+PCGaaZuLkk3p33yq371+Xog@mail.gmail.com>
2018-04-07  2:12             ` Hollow111
2018-04-09 12:16               ` n.pettik
2018-04-12  6:06                 ` Hollow111
2018-04-13  8:50                   ` n.pettik
2018-04-14  4:29                     ` Hollow111
2018-04-14  8:13                       ` n.pettik
2018-04-15  6:09                         ` Hollow111
2018-04-15  6:35                           ` Hollow111
2018-04-15 22:41                             ` n.pettik
2018-04-16 13:19                               ` Kirill Yukhin

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=926E041C-FCCB-46B0-B49B-21292CB70813@tarantool.org \
    --to=korablev@tarantool.org \
    --cc=hollow653@gmail.com \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH 2/2] sql: statistics removal after dropping an index' \
    /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