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 9A7752434D for ; Sat, 15 Dec 2018 07:05:09 -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 cUgYM966QEbN for ; Sat, 15 Dec 2018 07:05:09 -0500 (EST) Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (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 733C624343 for ; Sat, 15 Dec 2018 07:05:06 -0500 (EST) From: imeevma@tarantool.org Subject: [tarantool-patches] [PATCH v2 1/6] sql: remove unnecessary macros from pragma.* Date: Sat, 15 Dec 2018 14:54:48 +0300 Message-Id: <5e5daaaeb306feae8caf3af98a3708431c58062e.1544871594.git.imeevma@gmail.com> In-Reply-To: References: 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: v.shpilevoy@tarantool.org, tarantool-patches@freelists.org Some of the macros used in pragma.c and pragma.h are obsolete because the values they checked were deleted. Part of #3832 --- src/box/sql/pragma.c | 4 ---- src/box/sql/pragma.h | 30 +++--------------------------- 2 files changed, 3 insertions(+), 31 deletions(-) diff --git a/src/box/sql/pragma.c b/src/box/sql/pragma.c index 5c35017..c052015 100644 --- a/src/box/sql/pragma.c +++ b/src/box/sql/pragma.c @@ -467,7 +467,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); @@ -496,9 +495,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; @@ -535,7 +532,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