From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Wed, 5 Jun 2019 20:56:45 +0300 From: Vladimir Davydov Subject: Re: [tarantool-patches] Re: [PATCH 1/2] schema: add "_vcollation" sysview Message-ID: <20190605175645.wm3gyqtyb5i22oq4@esperanza> References: <5eab44d0494d7622ef5fbb77c45229a09212d9bc.1559219194.git.roman.habibov@tarantool.org> <20190604163159.5lctqc4kaclxo3rh@esperanza> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: To: Roman Khabibov Cc: tarantool-patches@freelists.org List-ID: On Wed, Jun 05, 2019 at 08:08:46PM +0300, Roman Khabibov wrote: > >> +local function upgrade_to_2_1_4() > >> + local _collation = box.space._collation > >> + local _index = box.space._index > >> + > >> + -- System space format usually is in order "id, owner, name...". > >> + -- The fields "name", "owner" are swapped in "_collation" format, > >> + -- due to the field "owner" was added after the "_collation" creation. > >> + box.space._index:delete{276, 1} > >> + log.info("update index name on _collation") > >> + box.space._index:insert{_collation.id, 2, 'name', 'tree', {unique = true}, > >> + {{1, 'string'}}} > >> + log.info("create index owner on _collation") > >> + box.space._index:insert{_collation.id, 1, 'owner', 'tree', {unique = false}, > >> + {{2, 'unsigned'}}} > > > > I don't understand this part. Why do you need to create 'owner' index? > > Why do you need to update 'name' index? > create_sysview() can’t work otherwise. I fail to see why is that. Could you please elaborate? > > + > +-- Fit _collation indexes to be suitable forcreate_sysview(). > +local function upgrade_collation_to_2_2_2() > + local _collation = box.space._collation > + local _index = box.space._index > > > > >> + create_vcollation_space() > >> +end > >> + > >> local function get_version() > >> local version = box.space._schema:get{'version'} > >> if version == nil then > >> @@ -768,6 +792,7 @@ local function upgrade(options) > >> {version = mkversion(2, 1, 1), func = upgrade_to_2_1_1, auto = true}, > >> {version = mkversion(2, 1, 2), func = upgrade_to_2_1_2, auto = true}, > >> {version = mkversion(2, 1, 3), func = upgrade_to_2_1_3, auto = true}, > >> + {version = mkversion(2, 1, 4), func = upgrade_to_2_1_4, auto = true} > > > > Should be in upgrade_to_2_2_1. > To 2.2.2 maybe? No. The last release was 2.2.0 so the next one will be 2.2.1.