From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp10.mail.ru (smtp10.mail.ru [94.100.181.92]) (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 2D32F46970E for ; Tue, 24 Dec 2019 18:30:43 +0300 (MSK) References: <79354099f03b9efe3a300ef4fd2c7d934876ae7b.1576071711.git.korablev@tarantool.org> <33e3b5df-45c3-83ff-3d0b-cbc1af6a1bae@tarantool.org> <20191224002621.GA31231@tarantool.org> From: Vladislav Shpilevoy Message-ID: <8e77686c-a97a-0781-7534-a4c556222291@tarantool.org> Date: Tue, 24 Dec 2019 16:30:41 +0100 MIME-Version: 1.0 In-Reply-To: <20191224002621.GA31231@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH v2 5/6] sql: extend result set with autoincrement List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nikita Pettik Cc: tarantool-patches@dev.tarantool.org Thanks for the patch! >> @@ -1845,12 +1846,9 @@ generate_column_metadata(struct Parse *pParse, struct SrcList *pTabList, >> space_def->fields[iCol].is_nullable; >> vdbe_metadata_set_col_nullability(v, i, >> is_nullable); >> - if (pTabList->a[j].space->sequence != NULL) { >> - int afno = >> - pTabList->a[j].space->sequence_fieldno; >> - if (afno == iCol) >> - vdbe_metadata_set_col_autoincrement(v, i); >> - } >> + if (space->sequence != NULL && >> + space->sequence_fieldno == iCol) >> + vdbe_metadata_set_col_autoincrement(v, i); Sorry, I know that I proposed this, but now I am getting a compilation error here: tarantool/src/box/sql/select.c:1850:33: error: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int' [-Werror,-Wsign-compare] space->sequence_fieldno == iCol) I don't know why was not it raised earlier. I've pushed my review fix on top of this commit. See it below and on the branch. ================================================================================ commit 53fd4b3b3a27cf99c6c7a71a085574b2fd8a0dc7 Author: Vladislav Shpilevoy Date: Tue Dec 24 15:56:24 2019 +0100 Review fix 5/6 diff --git a/src/box/sql/select.c b/src/box/sql/select.c index ddb2509f4..a19494ed9 100644 --- a/src/box/sql/select.c +++ b/src/box/sql/select.c @@ -1847,7 +1847,7 @@ generate_column_metadata(struct Parse *pParse, struct SrcList *pTabList, vdbe_metadata_set_col_nullability(v, i, is_nullable); if (space->sequence != NULL && - space->sequence_fieldno == iCol) + space->sequence_fieldno == (uint32_t) iCol) vdbe_metadata_set_col_autoincrement(v, i); } } else {