From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp54.i.mail.ru (smtp54.i.mail.ru [217.69.128.34]) (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 BD11342EF5D for ; Thu, 11 Jun 2020 18:18:55 +0300 (MSK) From: Roman Khabibov Date: Thu, 11 Jun 2020 18:18:53 +0300 Message-Id: <20200611151853.24398-3-roman.habibov@tarantool.org> In-Reply-To: <20200611151853.24398-1-roman.habibov@tarantool.org> References: <20200611151853.24398-1-roman.habibov@tarantool.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH v3 2/2] sql: print span more properly List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org Cc: v.shpilevoy@tarantool.org There were several cases where instead of the correct column span, the column name was printed. Fix this bug. Follow up #3962 --- src/box/sql/select.c | 2 +- test/sql/full_metadata.result | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/box/sql/select.c b/src/box/sql/select.c index b06240ca4..0a0d9ba14 100644 --- a/src/box/sql/select.c +++ b/src/box/sql/select.c @@ -1848,7 +1848,7 @@ generate_column_metadata(struct Parse *pParse, struct SrcList *pTabList, if (space->sequence != NULL && space->sequence_fieldno == (uint32_t) iCol) vdbe_metadata_set_col_autoincrement(v, i); - if (colname != NULL) + if (span != NULL) vdbe_metadata_set_col_span(v, i, span); } } else { diff --git a/test/sql/full_metadata.result b/test/sql/full_metadata.result index 25bac6d86..dc1e91115 100644 --- a/test/sql/full_metadata.result +++ b/test/sql/full_metadata.result @@ -65,7 +65,7 @@ execute("SELECT 'aSd' COLLATE \"unicode_ci\";") execute("SELECT c FROM t;") | --- | - metadata: - | - span: C + | - span: c | type: string | is_nullable: true | name: C @@ -89,16 +89,16 @@ execute("SELECT c COLLATE \"unicode\" FROM t;") execute("SELECT id, a, c FROM t;") | --- | - metadata: - | - span: ID + | - span: id | type: integer | is_autoincrement: true | name: ID | is_nullable: false | - type: integer - | span: A + | span: a | name: A | is_nullable: false - | - span: C + | - span: c | type: string | is_nullable: true | name: C -- 2.21.0 (Apple Git-122)