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 6EC39283B0 for ; Thu, 5 Apr 2018 14:01:50 -0400 (EDT) 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 Cy6BbJ7IjfYm for ; Thu, 5 Apr 2018 14:01:50 -0400 (EDT) Received: from smtp35.i.mail.ru (smtp35.i.mail.ru [94.100.177.95]) (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 2DD6928398 for ; Thu, 5 Apr 2018 14:01:49 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: [tarantool-patches] Re: [PATCH 2/2] sql: statistics removal after dropping an index From: "n.pettik" In-Reply-To: Date: Thu, 5 Apr 2018 21:01:48 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <926E041C-FCCB-46B0-B49B-21292CB70813@tarantool.org> References: <1522791436-8221-1-git-send-email-hollow653@gmail.com> 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: "N. Tatunov" Cc: tarantool-patches@freelists.org 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) */ =20 sqlite3BeginWriteOperation(pParse, 1); - sqlite3ClearStatTables(pParse, "tbl", pTab->zName); + sql_clear_stat_tables(pParse, pTab->zName, NULL);=20 @@ -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 wrote: >=20 > @@ -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. > *=20 > - * @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,=20 > + const char *idx_name > + ) This bracket should be on previous line. > { > - if(idx_name) { > + if(idx_name !=3D NULL) { > sqlite3NestedParse(parse, > "DELETE FROM \"_sql_stat1\" WHERE (\"idx\"=3D%Q = AND " > "\"tbl\"=3D%Q)", > =20