Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Roman Khabibov <roman.habibov@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v2 2/2] sql: support column addition
Date: Thu, 20 Aug 2020 00:20:23 +0200	[thread overview]
Message-ID: <8c4390aa-6b11-0d86-89f5-917226b75610@tarantool.org> (raw)
In-Reply-To: <3FF95208-4C8E-4094-A005-7A50415A8651@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 <CREATE TABLE> or
>>> +	 * <ALTER TABLE ADD COLUMN> 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 <CREATE TABLE> or
>>> +	 * a <ALTER TABLE ADD COLUMN> statement.
>>> +	 */
>>> +	struct rlist fkeys;
>>> +	struct rlist checks;
>>> +	uint32_t fkey_count;
>>> +	uint32_t check_count;
>>> +	/** True, if column to be created has <AUTOINCREMENT>. */
>>> +	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?

  reply	other threads:[~2020-08-19 22:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-03 15:27 [Tarantool-patches] [PATCH v2 0/2] Support column addition with <ALTER TABLE> Roman Khabibov
2020-04-03 15:27 ` [Tarantool-patches] [PATCH v2 1/2] sql: rename TK_COLUMN to TK_COLUMN_NAME Roman Khabibov
2020-04-24 22:55   ` Vladislav Shpilevoy
2020-08-11  0:34     ` Roman Khabibov
2020-04-03 15:27 ` [Tarantool-patches] [PATCH v2 2/2] sql: support column addition Roman Khabibov
2020-04-24 22:56   ` Vladislav Shpilevoy
2020-07-06 13:37     ` Roman Khabibov
2020-07-12 16:45       ` Vladislav Shpilevoy
2020-08-11  0:34         ` Roman Khabibov
2020-08-19 22:20           ` Vladislav Shpilevoy [this message]
2020-09-11 21:51             ` Roman Khabibov
2020-04-03 17:40 ` [Tarantool-patches] [PATCH v2 0/2] Support column addition with <ALTER TABLE> Roman Khabibov
2020-11-18 17:23 ` Alexander V. Tikhonov
2020-11-18 23:07   ` Nikita Pettik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8c4390aa-6b11-0d86-89f5-917226b75610@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=roman.habibov@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v2 2/2] sql: support column addition' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox