From: "Мерген Имеев" <imeevma@tarantool.org> To: "Vladislav Shpilevoy" <v.shpilevoy@tarantool.org>, tarantool-patches@freelists.org Subject: [tarantool-patches] Re: [tarantool-patches] Re: [PATCH v2 1/1] box: update collation strength option. Date: Fri, 12 Oct 2018 21:07:56 +0300 [thread overview] Message-ID: <1539367676.189590095@f400.i.mail.ru> (raw) [-- Attachment #1: Type: text/plain, Size: 2953 bytes --] Hello! Thank you for review! My answer below. On 10/12/2018 03:05 AM, Vladislav Shpilevoy wrote: >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. Replace couldn't be used in space box.space._collation: tarantool> 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:replace(new_collation) > end > end > end --- ... tarantool> update_collation_strength_field() --- - error: collation does not support alter ... >>+ end >> + end >> +end >> + >> +local function upgrade_to_2_1_1() >> + update_collation_strength_field() >> +end >> + >> + [-- Attachment #2: Type: text/html, Size: 5496 bytes --]
next reply other threads:[~2018-10-12 18:07 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-10-12 18:07 Мерген Имеев [this message] 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=1539367676.189590095@f400.i.mail.ru \ --to=imeevma@tarantool.org \ --cc=tarantool-patches@freelists.org \ --cc=v.shpilevoy@tarantool.org \ --subject='[tarantool-patches] Re: [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