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 472582AEBA for ; Wed, 27 Mar 2019 15:32:57 -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 73c6BvSbECtm for ; Wed, 27 Mar 2019 15:32:57 -0400 (EDT) Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (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 F19DA2AE8C for ; Wed, 27 Mar 2019 15:32:56 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH] sql: set explicit default collation's strength From: Vladislav Shpilevoy References: <20190326203456.76617-1-ivan.koptelov@tarantool.org> <8ab84a8f-213e-4bcd-217d-e5f694b70693@tarantool.org> <17D31B00-F24C-48C8-BE9D-CA4D32D35484@tarantool.org> Message-ID: <085718fe-734f-f141-b914-b21050f6e28c@tarantool.org> Date: Wed, 27 Mar 2019 22:32:54 +0300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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: "i.koptelov" , tarantool-patches@freelists.org 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 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.