From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Roman Khabibov <roman.habibov@tarantool.org>,
tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v2 2/2] sql: support column addition
Date: Sat, 25 Apr 2020 00:56:20 +0200 [thread overview]
Message-ID: <d99bcaca-b98e-f8d0-8a54-d86b8812697e@tarantool.org> (raw)
In-Reply-To: <20200403152752.8923-3-roman.habibov@tarantool.org>
Thanks for the patch!
You didn't respond to my 18 review comments to the previous
version of the patch. Please, do that so as I would know what
was decided on each of them.
See 3 comments below.
On 03/04/2020 17:27, Roman Khabibov wrote:
> Enable to add column to existing space with
> <ALTER TABLE ADD [COLUMN]> statement. Column definition can be
> supplemented with the four types of constraints, <DEFAULT>,
> <COLLATE> clauses and <[NOT] NULL>, AUTOINCREMENT.
>
> Closes #2349, #3075
>
> @TarantoolBot document
> Title: Add columns to existing tables in SQL
> Now, it is possible to add columns to existing empty spaces using
> <ALTER TABLE table_name ADD [COLUMN] column_name column_type ...>
1. Why COLUMN keyword is optional? Is it allowed by the standard?
> statement. The column definition is the same as in <CREATE TABLE>
> statement, except that table constraints (PRIMARY KEY, UNIQUE,
> REFERENCES, CHECK) cannot be specified yet.
2. Issue 2349 is about ability to add a UNIQUE column. Here you said
you 'Closes' it, and yet it can't be done, according to what you say
above. Why?
I tried that example:
tarantool> box.execute("ALTER TABLE te9 ADD s2 INT UNIQUE;")
---
- row_count: 0
...
So it is not forbidden.
Also I tried to follow the template and add explicit COLUMN:
tarantool> box.execute("ALTER TABLE te9 ADD COLUMN s2 INT UNIQUE;")
---
- null
- 'At line 1 at or near position 21: keyword ''COLUMN'' is reserved. Please use double
quotes if ''COLUMN'' is an identifier.'
...
Why doesn't it work?
>
> For example:
>
> tarantool> box.execute([[CREATE TABLE test (
> a INTEGER PRIMARY KEY
> );]])
> ---
> - row_count: 1
> ...
>
> tarantool> box.execute([[ALTER TABLE test ADD COLUMN
> b TEXT
> NOT NULL
> DEFAULT ('a')
> COLLATE "unicode_ci"
> ;]])
3. This example does not work. Gives the same error as the example above.
> ---
> - row_count: 0
> ...
I will continue the review once the comments above and the old 18 comments
are resolved
next prev parent reply other threads:[~2020-04-24 22:56 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 [this message]
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
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=d99bcaca-b98e-f8d0-8a54-d86b8812697e@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