Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Imeev Mergen <imeevma@tarantool.org>, tarantool-patches@freelists.org
Subject: [tarantool-patches] Re: [PATCH v2 1/1] box: update collation strength option.
Date: Fri, 12 Oct 2018 03:05:00 +0300	[thread overview]
Message-ID: <433e3e8c-1406-f1df-1939-4d1b155dc88e@tarantool.org> (raw)
In-Reply-To: <4412cfbc-8b29-3354-7c97-5b6bd038699e@tarantool.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
> +
> +

  reply	other threads:[~2018-10-12  0:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-06  9:04 [tarantool-patches] " imeevma
2018-10-10 11:18 ` [tarantool-patches] " Vladislav Shpilevoy
2018-10-11 18:10   ` Imeev Mergen
2018-10-12  0:05     ` Vladislav Shpilevoy [this message]
2018-10-12 18:07 [tarantool-patches] " Мерген Имеев
2018-10-13 12:17 ` Vladislav Shpilevoy
2018-10-15 18:30   ` Imeev Mergen

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=433e3e8c-1406-f1df-1939-4d1b155dc88e@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=imeevma@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH v2 1/1] box: update collation strength option.' \
    /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