[tarantool-patches] Re: [PATCH] sql: set explicit default collation's strength

i.koptelov ivan.koptelov at tarantool.org
Thu Mar 28 09:55:21 MSK 2019



> On 27 Mar 2019, at 22:32, Vladislav Shpilevoy <v.shpilevoy at tarantool.org> wrote:
> 
> 
> 
> On 27/03/2019 22:32, Vladislav Shpilevoy wrote:
>> 
>> 
>> On 27/03/2019 18:01, i.koptelov wrote:
>>> 
>>> 
>>>> On 27 Mar 2019, at 17:26, Vladislav Shpilevoy <v.shpilevoy at tarantool.org> wrote:
>>>> 
>>>> Please, apply the diff below. Be careful because I haven't tested it.
>>>> Fix it, if tests fail, and do not forget to regenerate boostrap.snap.
>>>> 
>>>> diff --git a/src/box/lua/upgrade.lua b/src/box/lua/upgrade.lua
>>>> index a23d0af64..37ab76177 100644
>>>> --- a/src/box/lua/upgrade.lua
>>>> +++ b/src/box/lua/upgrade.lua
>>>> @@ -638,10 +638,9 @@ end
>>>> 
>>>> local 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 and collation.name ~= 'none' and
>>>> -            collation.name ~= 'binary' then
>>>> -            local new_collation = _collation:get{collation.id}:totable()
>>>> +    for _, collation in _collation:pairs() do
>>>> +        if collation.type == 'ICU' and collation.opts.strength == nil then
>>>> +            local new_collation = collation:totable()
>>>>            new_collation[6].strength = 'tertiary'
>>>>            _collation:delete{collation.id}
>>>>            _collation:insert(new_collation)
>>>> 
>>> Ok, done. Tests are not broken, bootstrap.snap is regenerated.
>>> 
>> 
>> Looks like it is not done. You ignored last two lines: fix of
>> indentation and fix of excess lookup of a tuple which you already
>> have from pairs.
>> 
> 
> Sorry, indentation is ok. Only double lookup still is unfixed.
> 
Sorry, fixed now.



More information about the Tarantool-patches mailing list