Tarantool development patches archive
 help / color / mirror / Atom feed
* [tarantool-patches] Re: [tarantool-patches] Re: [PATCH v2 1/1] box: update collation strength option.
@ 2018-10-12 18:07 Мерген Имеев
  2018-10-13 12:17 ` Vladislav Shpilevoy
  0 siblings, 1 reply; 3+ messages in thread
From: Мерген Имеев @ 2018-10-12 18:07 UTC (permalink / raw)
  To: Vladislav Shpilevoy, tarantool-patches

[-- 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 --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-10-15 18:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-12 18:07 [tarantool-patches] Re: [tarantool-patches] Re: [PATCH v2 1/1] box: update collation strength option Мерген Имеев
2018-10-13 12:17 ` Vladislav Shpilevoy
2018-10-15 18:30   ` Imeev Mergen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox