From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp29.i.mail.ru (smtp29.i.mail.ru [94.100.177.89]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id CF1B946970E for ; Tue, 31 Dec 2019 07:15:12 +0300 (MSK) Date: Tue, 31 Dec 2019 07:15:09 +0300 From: Mergen Imeev Message-ID: <20191231041508.GB29460@tarantool.org> References: <5bbe13f8c1c11311a1d68d23fbccb56c763f0365.1577724051.git.imeevma@gmail.com> <20191230231218.GA98764@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20191230231218.GA98764@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH v2 2/9] sql: remove PRAGMA "short_column_names" List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nikita Pettik Cc: tarantool-patches@dev.tarantool.org Thank you for review! Applied the diff. On Tue, Dec 31, 2019 at 01:12:18AM +0200, Nikita Pettik wrote: > On 30 Dec 19:43, imeevma@tarantool.org wrote: > > @@ -1828,11 +1825,12 @@ generate_column_metadata(struct Parse *pParse, struct SrcList *pTabList, > > struct space_def *space_def = space->def; > > assert(iCol >= 0 && iCol < (int)space_def->field_count); > > zCol = space_def->fields[iCol].name; > > - const char *name = colname; > > - if (name == NULL) { > > - if (!shortNames && !fullNames) { > > - name = span; > > - } else if (fullNames) { > > + const char *name = NULL; > > + if (pEList->a[i].zName != NULL) { > > + name = pEList->a[i].zName; > > + } else { > > + int flags = pParse->sql_flags; > > + if ((flags & SQL_FullColNames) != 0) { > > name = tt_sprintf("%s.%s", > > space_def->name, > > Please, apply this refactoring: > > diff --git a/src/box/sql/select.c b/src/box/sql/select.c > index 0fc86e550..65e41f219 100644 > --- a/src/box/sql/select.c > +++ b/src/box/sql/select.c > @@ -1825,10 +1825,8 @@ generate_column_metadata(struct Parse *pParse, struct SrcList *pTabList, > struct space_def *space_def = space->def; > assert(iCol >= 0 && iCol < (int)space_def->field_count); > zCol = space_def->fields[iCol].name; > - const char *name = NULL; > - if (pEList->a[i].zName != NULL) { > - name = pEList->a[i].zName; > - } else { > + const char *name = colname; > + if (name == NULL) { >