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 F3860210EA for ; Wed, 26 Dec 2018 13:18:01 -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 fyo0gZLO4ZDE for ; Wed, 26 Dec 2018 13:18:01 -0500 (EST) Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (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 AD9D1210E7 for ; Wed, 26 Dec 2018 13:18:01 -0500 (EST) From: imeevma@tarantool.org Subject: [tarantool-patches] [PATCH v3 1/6] sql: remove unused macros from pragma.c and pragma.h Date: Wed, 26 Dec 2018 21:17:59 +0300 Message-Id: MIME-Version: 1.0 In-Reply-To: References: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit 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, korablev@tarantool.org Hi! Thank you for review! My answers and new version below. I didn't include diff, because all that changed was the commit message. On 12/24/18 5:01 PM, n.pettik wrote: > Nit: at the end of commit subject redundant ‘*’ and dot. Fixed. > They weren’t deleted, they are simply not used. > I guess they still can be enabled, if add appropriate commands > to cmake lists. On the other hand, I doubt that someday we > really may need them. Made changes in in commit-message. > In fact, this commit has nothing in common with mentioned issue. Removed from commit-message. > Why didn’t you remove ENABLE_SELECTTRACE as well? I didn't remove it because it can be set through cmake. > The same question. Can also be set via cmake. New version: commit bce2e738fc866b2637bc167aa87bc37bd308474b Author: Mergen Imeev Date: Wed Dec 12 21:58:54 2018 +0300 sql: remove unused macros from pragma.c and pragma.h Some macros in pragma.c and pragma.h are obsolete because the values they are checking are no longer used. Let's remove them. diff --git a/src/box/sql/pragma.c b/src/box/sql/pragma.c index eef1ed9..5729fe6 100644 --- a/src/box/sql/pragma.c +++ b/src/box/sql/pragma.c @@ -465,7 +465,6 @@ sqlite3Pragma(Parse * pParse, Token * pId, /* First part of [schema.]id field */ /* Jump to the appropriate pragma handler */ switch (pPragma->ePragTyp) { -#ifndef SQLITE_OMIT_FLAG_PRAGMAS case PragTyp_FLAG:{ if (zRight == 0) { setPragmaResultColumnNames(v, pPragma); @@ -494,9 +493,7 @@ sqlite3Pragma(Parse * pParse, Token * pId, /* First part of [schema.]id field */ } break; } -#endif /* SQLITE_OMIT_FLAG_PRAGMAS */ -#ifndef SQLITE_OMIT_SCHEMA_PRAGMAS case PragTyp_TABLE_INFO: sql_pragma_table_info(pParse, zRight); break; @@ -538,7 +535,6 @@ sqlite3Pragma(Parse * pParse, Token * pId, /* First part of [schema.]id field */ box_iterator_free(iter); break; } -#endif /* SQLITE_OMIT_SCHEMA_PRAGMAS */ case PragTyp_FOREIGN_KEY_LIST:{ if (zRight == NULL) diff --git a/src/box/sql/pragma.h b/src/box/sql/pragma.h index e608016..84ab478 100644 --- a/src/box/sql/pragma.h +++ b/src/box/sql/pragma.h @@ -97,41 +97,32 @@ static const PragmaName aPragmaName[] = { /* ePragFlg: */ PragFlg_NoColumns, /* ColNames: */ 0, 0, /* iArg: */ 0}, -#if !defined(SQLITE_OMIT_SCHEMA_PRAGMAS) { /* zName: */ "collation_list", /* ePragTyp: */ PragTyp_COLLATION_LIST, /* ePragFlg: */ PragFlg_Result0, /* ColNames: */ 21, 2, /* iArg: */ 0}, -#endif -#if !defined(SQLITE_OMIT_FLAG_PRAGMAS) { /* zName: */ "count_changes", /* ePragTyp: */ PragTyp_FLAG, /* ePragFlg: */ PragFlg_Result0 | PragFlg_NoColumns1, /* ColNames: */ 0, 0, /* iArg: */ SQLITE_CountRows}, -#endif -#if !defined(SQLITE_OMIT_FLAG_PRAGMAS) { /* zName: */ "defer_foreign_keys", /* ePragTyp: */ PragTyp_FLAG, /* ePragFlg: */ PragFlg_Result0 | PragFlg_NoColumns1, /* ColNames: */ 0, 0, /* iArg: */ SQLITE_DeferFKs}, -#endif { /* zName: */ "foreign_key_list", /* ePragTyp: */ PragTyp_FOREIGN_KEY_LIST, /* ePragFlg: */ PragFlg_NeedSchema | PragFlg_Result1 | PragFlg_SchemaOpt, /* ColNames: */ 23, 8, /* iArg: */ 0}, -#if !defined(SQLITE_OMIT_FLAG_PRAGMAS) { /* zName: */ "full_column_names", /* ePragTyp: */ PragTyp_FLAG, /* ePragFlg: */ PragFlg_Result0 | PragFlg_NoColumns1, /* ColNames: */ 0, 0, /* iArg: */ SQLITE_FullColNames}, -#endif -#if !defined(SQLITE_OMIT_SCHEMA_PRAGMAS) { /* zName: */ "index_info", /* ePragTyp: */ PragTyp_INDEX_INFO, /* ePragFlg: */ @@ -144,15 +135,13 @@ static const PragmaName aPragmaName[] = { PragFlg_NeedSchema | PragFlg_Result1 | PragFlg_SchemaOpt, /* ColNames: */ 16, 5, /* iArg: */ 0}, -#endif -#if defined(SQLITE_DEBUG) && !defined(SQLITE_OMIT_PARSER_TRACE) +#if defined(SQLITE_DEBUG) { /* zName: */ "parser_trace", /* ePragTyp: */ PragTyp_PARSER_TRACE, /* ePragFlg: */ 0, /* ColNames: */ 0, 0, /* iArg: */ 0}, #endif -#if !defined(SQLITE_OMIT_FLAG_PRAGMAS) { /* zName: */ "query_only", /* ePragTyp: */ PragTyp_FLAG, /* ePragFlg: */ PragFlg_Result0 | PragFlg_NoColumns1, @@ -168,28 +157,23 @@ static const PragmaName aPragmaName[] = { /* ePragFlg: */ PragFlg_Result0 | PragFlg_NoColumns1, /* ColNames: */ 0, 0, /* iArg: */ SQLITE_RecTriggers}, -#endif -#if !defined(SQLITE_OMIT_FLAG_PRAGMAS) { /* zName: */ "reverse_unordered_selects", /* ePragTyp: */ PragTyp_FLAG, /* ePragFlg: */ PragFlg_Result0 | PragFlg_NoColumns1, /* ColNames: */ 0, 0, /* iArg: */ SQLITE_ReverseOrder}, -#endif -#if !defined(SQLITE_OMIT_FLAG_PRAGMAS) && defined(SQLITE_ENABLE_SELECTTRACE) +#if defined(SQLITE_ENABLE_SELECTTRACE) { /* zName: */ "select_trace", /* ePragTyp: */ PragTyp_FLAG, /* ePragFlg: */ PragFlg_Result0 | PragFlg_NoColumns1, /* ColNames: */ 0, 0, /* iArg: */ SQLITE_SelectTrace}, #endif -#if !defined(SQLITE_OMIT_FLAG_PRAGMAS) { /* zName: */ "short_column_names", /* ePragTyp: */ PragTyp_FLAG, /* ePragFlg: */ PragFlg_Result0 | PragFlg_NoColumns1, /* ColNames: */ 0, 0, /* iArg: */ SQLITE_ShortColNames}, -#endif { /* zName: */ "sql_compound_select_limit", /* ePragTyp: */ PragTyp_COMPOUND_SELECT_LIMIT, /* ePragFlg: */ PragFlg_Result0, @@ -200,7 +184,6 @@ static const PragmaName aPragmaName[] = { /* ePragFlg: */ PragFlg_Result0 | PragFlg_NoColumns1, /* ColNames: */ 0, 0, /* iArg: */ 0}, -#if !defined(SQLITE_OMIT_FLAG_PRAGMAS) #if defined(SQLITE_DEBUG) { /* zName: */ "sql_trace", /* ePragTyp: */ PragTyp_FLAG, @@ -208,24 +191,18 @@ static const PragmaName aPragmaName[] = { /* ColNames: */ 0, 0, /* iArg: */ SQLITE_SqlTrace}, #endif -#endif -#if !defined(SQLITE_OMIT_SCHEMA_PRAGMAS) { /* zName: */ "stats", /* ePragTyp: */ PragTyp_STATS, /* ePragFlg: */ PragFlg_NeedSchema | PragFlg_Result0 | PragFlg_SchemaReq, /* ColNames: */ 6, 4, /* iArg: */ 0}, -#endif -#if !defined(SQLITE_OMIT_SCHEMA_PRAGMAS) { /* zName: */ "table_info", /* ePragTyp: */ PragTyp_TABLE_INFO, /* ePragFlg: */ PragFlg_NeedSchema | PragFlg_Result1 | PragFlg_SchemaOpt, /* ColNames: */ 0, 6, /* iArg: */ 0}, -#endif -#if !defined(SQLITE_OMIT_FLAG_PRAGMAS) #if defined(SQLITE_DEBUG) { /* zName: */ "vdbe_addoptrace", /* ePragTyp: */ PragTyp_FLAG, @@ -254,8 +231,7 @@ static const PragmaName aPragmaName[] = { /* ColNames: */ 0, 0, /* iArg: */ SQLITE_VdbeTrace}, #endif -#endif -#if !defined(SQLITE_OMIT_FLAG_PRAGMAS) && defined(SQLITE_ENABLE_WHERETRACE) +#if defined(SQLITE_ENABLE_WHERETRACE) { /* zName: */ "where_trace", /* ePragTyp: */ PragTyp_FLAG, -- 2.7.4