From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (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 68BC8430407 for ; Thu, 20 Aug 2020 01:20:25 +0300 (MSK) References: <20200403152752.8923-1-roman.habibov@tarantool.org> <20200403152752.8923-3-roman.habibov@tarantool.org> <5CF72787-A1F0-4C48-BA8F-08F02B6960F6@tarantool.org> <3FF95208-4C8E-4094-A005-7A50415A8651@tarantool.org> From: Vladislav Shpilevoy Message-ID: <8c4390aa-6b11-0d86-89f5-917226b75610@tarantool.org> Date: Thu, 20 Aug 2020 00:20:23 +0200 MIME-Version: 1.0 In-Reply-To: <3FF95208-4C8E-4094-A005-7A50415A8651@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH v2 2/2] sql: support column addition List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Roman Khabibov Cc: tarantool-patches@dev.tarantool.org Hi! Thanks for the patch! >>> + parser->has_autoinc = false; >>> region_create(&parser->region, &cord()->slabc); >>> } >>> >>> diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h >>> index aa6a470f8..3143ec521 100644 >>> --- a/src/box/sql/sqlInt.h >>> +++ b/src/box/sql/sqlInt.h >>> @@ -2249,12 +2249,26 @@ struct Parse { >>> struct enable_entity_def enable_entity_def; >>> }; >>> /** >>> - * Table def is not part of union since information >>> - * being held must survive till the end of parsing of >>> - * whole CREATE TABLE statement (to pass it to >>> - * sqlEndTable() function). >>> + * Table def or column def is not part of union since >>> + * information being held must survive till the end of >>> + * parsing of whole or >>> + * statement (to pass it to >>> + * sqlEndTable() sql_create_column_end() function). >>> */ >>> struct create_table_def create_table_def; >>> + struct create_column_def create_column_def; >>> + /** >>> + * FK and CK constraints appeared in a or >>> + * a statement. >>> + */ >>> + struct rlist fkeys; >>> + struct rlist checks; >>> + uint32_t fkey_count; >>> + uint32_t check_count; >>> + /** True, if column to be created has . */ >>> + bool has_autoinc; >> >> 27. What column? This is struct Parse, it is not a column. > I know, but I haven't come up with anything better. Why can't autoinc field be moved into create_column_def, since this is related to only one column? Can you move struct rlist fkeys and uint32_t fkey_count into a new struct like 'struct create_fkeys_def;', and the same for checks?