From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 232632D260 for ; Thu, 11 Oct 2018 20:05:05 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id R5j2FxycagYU for ; Thu, 11 Oct 2018 20:05:05 -0400 (EDT) Received: from smtp33.i.mail.ru (smtp33.i.mail.ru [94.100.177.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id E0BF02D224 for ; Thu, 11 Oct 2018 20:05:03 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH v2 1/1] box: update collation strength option. References: <4412cfbc-8b29-3354-7c97-5b6bd038699e@tarantool.org> From: Vladislav Shpilevoy Message-ID: <433e3e8c-1406-f1df-1939-4d1b155dc88e@tarantool.org> Date: Fri, 12 Oct 2018 03:05:00 +0300 MIME-Version: 1.0 In-Reply-To: <4412cfbc-8b29-3354-7c97-5b6bd038699e@tarantool.org> Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: Imeev Mergen , tarantool-patches@freelists.org Thanks for the fixes! See 1 comment below. > diff --git a/src/box/lua/upgrade.lua b/src/box/lua/upgrade.lua > index d9c2ae4..66dcef4 100644 > --- a/src/box/lua/upgrade.lua > +++ b/src/box/lua/upgrade.lua > @@ -578,6 +578,27 @@ local function upgrade_to_2_1_0() >      box.space._schema:format(format) >  end > > +-------------------------------------------------------------------------------- > +-- Tarantool 2.1.1 > +-------------------------------------------------------------------------------- > + > +function update_collation_strength_field() > +    local _collation = box.space[box.schema.COLLATION_ID] > +    for _, collation in ipairs(_collation:select()) do > +        if (collation.opts.strength == nil) then > +            local new_collation = _collation:get{collation.id}:totable() > +            new_collation[6].strength = 'identical' > +            _collation:delete{collation.id} > +            _collation:insert(new_collation) Why did you remove replace from my diff and replaced it with delete + insert? collation.id is a primary index and it is the same in the new and old collation. It makes no sense to do delete + insert, when you can do one replace. > +        end > +    end > +end > + > +local function upgrade_to_2_1_1() > +    update_collation_strength_field() > +end > + > +