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 93AB12A923 for ; Sun, 16 Sep 2018 15:32:36 -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 3DYaEKLT0Z5Q for ; Sun, 16 Sep 2018 15:32:36 -0400 (EDT) Received: from smtp63.i.mail.ru (smtp63.i.mail.ru [217.69.128.43]) (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 510BC2A90C for ; Sun, 16 Sep 2018 15:32:36 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH 1/7] sql: remove struct schema from struct Table References: From: Vladislav Shpilevoy Message-ID: Date: Sun, 16 Sep 2018 21:32:30 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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, Nikita Pettik Patchset LGTM. I've not reviewed it again, but the fixes look ok. On 24/08/2018 00:55, Nikita Pettik wrote: > 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; >