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 10D9B4696C3 for ; Sat, 25 Apr 2020 01:56:22 +0300 (MSK) References: <20200403152752.8923-1-roman.habibov@tarantool.org> <20200403152752.8923-3-roman.habibov@tarantool.org> From: Vladislav Shpilevoy Message-ID: Date: Sat, 25 Apr 2020 00:56:20 +0200 MIME-Version: 1.0 In-Reply-To: <20200403152752.8923-3-roman.habibov@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 , tarantool-patches@dev.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 > statement. Column definition can be > supplemented with the four types of constraints, , > 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 > 1. Why COLUMN keyword is optional? Is it allowed by the standard? > statement. The column definition is the same as in > 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