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 622B02A3E3 for ; Thu, 23 Aug 2018 18:56:14 -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 8dSfQVnDO3l6 for ; Thu, 23 Aug 2018 18:56:14 -0400 (EDT) Received: from smtp48.i.mail.ru (smtp48.i.mail.ru [94.100.177.108]) (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 C7ADD2A004 for ; Thu, 23 Aug 2018 18:56:13 -0400 (EDT) From: Nikita Pettik Subject: [tarantool-patches] [PATCH 1/7] sql: remove struct schema from struct Table Date: Fri, 24 Aug 2018 01:55:47 +0300 Message-Id: In-Reply-To: References: 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: tarantool-patches@freelists.org Cc: v.shpilevoy@tarantool.org, Nikita Pettik Part of #3561 --- src/box/sql/build.c | 7 ++----- src/box/sql/select.c | 2 +- src/box/sql/sqliteInt.h | 1 - 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/box/sql/build.c b/src/box/sql/build.c index dc00b5d8c..47fa7c305 100644 --- a/src/box/sql/build.c +++ b/src/box/sql/build.c @@ -392,8 +392,6 @@ sqlite3PrimaryKeyIndex(Table * pTab) static Table * sql_table_new(Parse *parser, char *name) { - sqlite3 *db = parser->db; - struct Table *table = sql_ephemeral_table_new(parser, name); if (table == NULL) return NULL; @@ -401,7 +399,6 @@ sql_table_new(Parse *parser, char *name) strcpy(table->def->engine_name, sql_storage_engine_strs[current_session()->sql_default_engine]); - table->pSchema = db->pSchema; table->nTabRef = 1; return table; } @@ -1650,8 +1647,8 @@ sqlite3EndTable(Parse * pParse, /* Parse context */ * Add the table to the in-memory representation * of the database. */ - struct Table *pOld = sqlite3HashInsert(&p->pSchema->tblHash, - p->def->name, p); + struct Table *pOld = sqlite3HashInsert(&db->pSchema->tblHash, + p->def->name, p); if (pOld != NULL) { assert(p == pOld); sqlite3OomFault(db); diff --git a/src/box/sql/select.c b/src/box/sql/select.c index d22f4e0a9..12f55cedf 100644 --- a/src/box/sql/select.c +++ b/src/box/sql/select.c @@ -1672,7 +1672,7 @@ columnTypeImpl(NameContext * pNC, Expr * pExpr columnType(&sNC, p, &zOrigTab, &zOrigCol); } - } else if (pTab->pSchema) { + } else { /* A real table */ assert(!pS); assert(iCol >= 0 && diff --git a/src/box/sql/sqliteInt.h b/src/box/sql/sqliteInt.h index d2ef85846..35d3f4cec 100644 --- a/src/box/sql/sqliteInt.h +++ b/src/box/sql/sqliteInt.h @@ -1857,7 +1857,6 @@ struct Table { * can be fetched from space struct. */ LogEst tuple_log_count; - Schema *pSchema; /* Schema that contains this table */ Table *pNextZombie; /* Next on the Parse.pZombieTab list */ /** Space definition with Tarantool metadata. */ struct space_def *def; -- 2.15.1