From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp61.i.mail.ru (smtp61.i.mail.ru [217.69.128.41]) (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 55E2A46970E for ; Tue, 31 Dec 2019 02:12:20 +0300 (MSK) Date: Tue, 31 Dec 2019 01:12:18 +0200 From: Nikita Pettik Message-ID: <20191230231218.GA98764@tarantool.org> References: <5bbe13f8c1c11311a1d68d23fbccb56c763f0365.1577724051.git.imeevma@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5bbe13f8c1c11311a1d68d23fbccb56c763f0365.1577724051.git.imeevma@gmail.com> 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: imeevma@tarantool.org Cc: tarantool-patches@dev.tarantool.org 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) {